Only the top of Daniel Miller's head was visible above the murky water.

A desperate determination to see his wife and children again has been credited with helping to sustain a man as he was trapped for hours in a dam in New South Wales, Australia, this week, with just his nose and the top of his head poking out of the dirty water.

Daniel Miller, 45, remains in John Hunter Hospital in Newcastle in a stable condition following his incredible ordeal at the property in Charlotte Bay, on the NSW mid north coast, on Tuesday.

Daniel Miller was driving a three-tonne mini excavator when the banks of the small dam gave way and the machine toppled into the water. His family says he was trapped beneath the excavator's roll bar for five hours, as his feet slowly sank in the mud.

SAIMAA MILLER/FACEBOOK Firefighters work to free Daniel Miller from the dam at his property in Charlotte Bay.

Just how he managed to arch his back and keep his nose above the waterline, while sporadically yelling out for help, left his family and emergency service workers stunned. One firefighter said the weight of the excavator pushing on Daniel Miller's back meant he was virtually doing a push-up for hours.

READ MORE

* Teamwork retrieved snowbound 4WDs

* Man stuck between buildings, 10 floors up

* Horrified tourists watch swimmers desperately try to save each other from raging Waikato River

SAIMAA MILLER/FACEBOOK Daniel Miller was covered in mud when he was pulled up the dam's banks.

A neighbour heard Daniel Miller's cries and alerted emergency services, sparking a delicate rescue operation to free him from the murky water.

"Dan is ok!," Daniel Miller's relieved wife, Saimaa, posted online overnight, along with photographs of the incredible rescue effort.

"He , with the weight of his excavator on his back, and with the boggy dam ground below him slowly slipping away. For five hours.

SAIMAA MILLER/FACEBOOK Daniel Miller was flown to John Hunter Hospital in a stable condition.

"It was literally sheer mental strength and determination to survive that got him through. As well as being fit, strong and healthy. Nothing to do with luck. Legendary effort from a legendary man."

A neighbour who saw the rescue effort unfold said Daniel Miller displayed "such incredible strength and determination of a man wanting to see his wife and children again".

"It was such a shocking accident and Dan knows how lucky he is to be alive, but he also fought it all the way. Love you guys," the neighbour, Julie, wrote. It was not immediately clear whether she was the neighbour who raised the alarm.

Saimaa Miller, who runs a spa and health retreat on the NSW Mid North Coast, thanked everyone involved in the "incredible effort" to rescue her husband.

"We are so grateful for the community support," she said.

Chief Inspector Neil Stephens told NBN News that Daniel Miller was "extremely lucky to survive".

"He was trapped such that only just a part of his face was above the water, just his nose and his forehead was above the water," he said.

Fire and Rescue NSW firefighters could not lift the excavator off Daniel Miller because the dam floor was too unstable. Firefighters waded into the dam and dug beneath Daniel Miller's body to lower him down and slide him out from beneath the roll bar.

Daniel Miller was flown to hospital suffering from mild hypothermia, but he escaped serious injury.