WELLINGTON (Reuters) - Three teenage boys set adrift for 50 days in a small boat in the South Pacific survived on coconuts, a seagull they managed to catch and by drinking rain and then sea water, rescuers said on Friday.

“It was a miracle we got to them,” said Tai Fredricsen, first mate on the fishing boat that rescued the boys.

“They are in incredibly good shape for the time they have been at sea. Somehow they caught a bird, I don’t know how, but they caught it. They ate it, that is what is recommended (in survival manuals),” Fredricsen told New Zealand media.

The boys, from the New Zealand territory of Tokelau, disappeared from its Atafu atoll on October 6.

After an extensive air and sea search failed to find the teenagers, their families became convinced they had died at sea, and two weeks ago held a memorial service for them on the tiny coral atoll, a Maritime New Zealand spokesman said on Friday.

Etueni Nasau, 14, Samu Pelesa, 15, and Filo Filo, 15, drifted 1,300 km (800 miles) across an empty, and little traveled, section of the Pacific Ocean.

On Thursday, a New Zealand fishing boat, the San Nikanau, sailing near the French territory of Wallis and Futuna spotted the boys’ floundering boat off its bow.

“Yesterday we saw a small vessel, a little speed boat on our bows, and we knew it was a little weird,” said Fredricsen.

“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 the tuna ship.

“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,” said Fredricsen.

“They were very skinny, but physically in good health, compared to what they have been through.”

The boys had a couple of coconuts on board but no water when rescued. They said they had left their island home to travel to a nearby island and had enough coconuts to last two days.

It is not known why the boys failed to reach the island.

The Tokelau Islands consist of three small atolls in the Pacific Ocean, about midway between New Zealand and Hawaii.

The boys were lucky to be spotted as the San Nikunau would normally off-load its catch in American Samoa, but had opted to head toward New Zealand.

“We generally don’t take this route and we were following the fastest line to New Zealand,” said Fredricsen.

The San Nikunau was now sailing to Fiji so the boys can receive medial treatment.