Three New Zealand boys survived on raw seagull, coconuts and seawater before they were found by chance by a fishing boat Reuters

Three teenagers have been rescued after 50 days adrift in a small boat in the Pacific Ocean, surviving on coconuts, a seagull and seawater.

Samuel Perez and Filo Filo, both 15, and Edward Nasau, 14, disappeared from Atafu atoll, north of Samoa and part of the New Zealand territory of Tokelau, on a small aluminium boat after an annual sporting event on 5 October. An extensive search by New Zealand air force Orion found no trace of them. Some 500 people on Atafu had held memorial services for the boys.

They were rescued by chance when a New Zealand fishing boat ventured into an area where it would not normally go. The boys had drifted 1,300 km (808 miles) and were west of Uvea in the French territory of Wallis and Futuna and north-east of Fiji when a tuna boat heading for Auckland found them.

"Yesterday we saw a small vessel, a little speed boat on our bows, and we knew it was a little weird," the first mate, Tai Fredricsen, told stuff.co.nz. "We had enough smarts to know there were people in it and those people were not supposed to be there."

About a mile out the boys started waving to them. "I pulled the vessel up as close as I could to them and asked them if they needed any help… they said very much so, they were ecstatic to see us … They were very skinny, but physically in good health, compared to what they have been through."

Fredricsen, the ship's medic, put them on an intravenous drip, but the boys were able to sip water and soon wanted real food. "They are in incredibly good shape for the time they have been at sea," he said.

The boys had a couple of coconuts on board which they finished after two days but were without water. "Somehow they caught a bird, I don't know how, but they caught it. They ate it; that is what is recommended," Fredricsen said. "They had a period when they were only drinking fresh water, which they were capturing during the night in a tarpaulin. They also told me that two weeks prior to us rescuing them, they were able to catch a sea bird which was very lucky for them."

Their luck seemed to run out when it stopped raining days before the rescue and they resorted to taking sips of seawater.

"They did mention that during the last two days they had started drinking salt water, which could have been disastrous for them," said Fredricsen, who thought the trio couldn't have survived much longer. "It was a miracle we got to them in time," he said.

An aunt of Perez told the BBC that the family had been devastated after the memorial service.

"My mum, she cried very day and every night," Fekei said. "We believed he was still alive anyway, we thought that God was still with them."

She said she thought the boys might have been trying to sail to Australia or the US.

After speaking to Sam on the telephone, she said: "He was asking for forgiveness. I think they did learn a big lesson".

The boys were extremely fortunate that the fishing boat, the San Nikunau, happened to be in their vicinity. The boat, which had been fishing in Kiribati waters, would normally off-load its catch in American Samoa. Instead it was on its way back to New Zealand.

"We generally don't take this route and we were following the fastest line to New Zealand," said Fredericsen.

The boys are expected to be put ashore at Suva, Fiji, today (Friday).

To get to Atafu, though, they will have to fly to Samoa and then take a boat trip back home as Tokelau, New Zealand's northernmost point, has neither airport nor harbour.

A Chinese sailor is thought to hold the record for survival at sea. Poon Lim spent 133 days alone in the south Atlantic after a British merchant ship, SS Ben Lomond, was torpedoed by a German U-boat in November 1942.