A seven-year-old boy is fighting for his life after spending about six hours waiting to be rescued from a sinking boat off the Sunshine Coast.

Water police raced to find the boy and two adults after receiving a distress call from the 5.2-metre vessel, which was taking on water just after 1.30am on Sunday.

The coast guard was deployed to their last known location about 14km off the coast of Caloundra and all vessels in the area were notified the boat was sinking, police said.

The trio were spotted in the water by a tanker that was anchored offshore, which notified authorities who rescued them just before 8am.

The two men had taken turns holding the young boy out of the water, while they clung to an esky, the Courier-Mail reported. The boat sank too quickly for any of the trio to put on life jackets, authorities said.

“It is very lucky that all three were found alive this morning,” a Queensland Ambulance Service senior operations supervisor, Kristy MacAlister, said on Sunday.

The boy was winched into a helicopter and taken to Sunshine Coast University hospital, where he remains in a critical condition.

“He was suffering from hypothermia because he had been in the water for quite some time,” MacAlister said.

The two men, aged 48 and 39, were brought back to land by marine rescue. It is understood they were also suffering hypothermia.