Valhalla — A medical doctor saves his family in the nick of time — just before they succumb to deadly carbon monoxide fumes.

Rabi Sinha, his wife and two children were at their Dutchess County home when they started to become ill.

Sinha thought his family had food poisoning. But he soon found his ten-year-old daughter unconscious and his wife and seven-year-old son semiconscious and realized it was something worse.

Sinha dialed 9-1-1 — just before he passed out himself.

Ambulances arrived and took the family to Vassar Brothers Hospital in Poughkeepsie where they were stabilized.

They were transferred to Westchester Medical Center in Valhalla and treated in hyperbaric chambers.

The family is expected to be released today.

Officials say the carbon monoxide fumes apparently came from a gas leak at the family’s home.