A man who miraculously survived two nights inside his car during one of the Midwest's worse storms this winter learned while recovering in the hospital that he has stage 4 kidney cancer.

William Mendoza, 59, was driving on Interstate 94 just west of Fargo, North Dakota, looking for a hotel on Feb. 6 when blizzard conditions began, he told ABC Saint Paul, Minnesota, affiliate KSTP.

To add to the danger, William Mendoza then began feeling disoriented, and when his car got stuck in a snowdrift, he couldn't call for help because his phone was dead, he said.

"You’re mostly thinking survival. 'OK. How am I gonna get through this?' You know? 'I got no heat, no light, how much gas do I have?'" he said.

The first night came and went with no rescuers, and in the second, temperatures dropped below zero. Also without food or water, William Mendoza described the time spent in his car those nights as excruciating.

"All I could remember was just shivering uncontrollably," he said. "You know, with the teeth shattering, the knees knocking."

Meanwhile, his wife was about 250 miles southeast at their home in Scandia, Minnesota, unable to sleep or eat over the stress of not knowing where her husband was.

North Dakota Highway Patrol gives residents updates on road conditions following a blizzard on Feb. 6.(North Dakota Highway Patrol) North Dakota Highway Patrol gives residents updates on road conditions following a blizzard on Feb. 6.

"Your heart just sinks," Vicki Mendoza told KSTP. "It's panic. It's worry."

On the third day, a telephone repairman who happened to be driving by spotted William Mendoza in his car.

"I'm not lost anymore," he recalled thinking after he was rescued.

When he was taken to the hospital, he had frostbite on his toes, and after doctors brought him out of severe hypothermia, they told him he was going to survive.

But on Feb. 10, his 59th birthday, doctors gave him the opposite kind of news, informing him that he had been diagnosed with advanced cancer.

"It’s like a cruel twist of fate," Vicki Mendoza said. "We see the God-given miracle that he’s alive through this snowstorm to find out he has this cancer.”

North Dakota Highway Patrol gives residents updates on road conditions following a blizzard on Feb. 6.(North Dakota Highway Patrol) North Dakota Highway Patrol gives residents updates on road conditions following a blizzard on Feb. 6.

William Mendoza plans on battling the cancer the same way he battled the cold: head-on.

"I am determined to do whatever I have to do to fight this," he said. "It was something they found while treating me for the hypothermia, and I guess it is better to know and get on with fighting it than to not know."

The family has created a GoFundMe campaign called "Jim Mendoza: Midwestern Miracle" to help pay for his medical expenses.

ABC News' Rachel Katz contributed to this report.