Madagascar's police minister says he swam for nearly 12 hours to reach the shore after being involved in a helicopter crash at sea on Tuesday.
Serge Gellé was one of two survivors. Two other people, a gendarme and the pilot, are still missing and feared dead.
The surviving secretary of state and gendarme were found separately by local residents on the beach at Mahambo, about 75km north of Toamasina, the major port city in eastern Madagascar, the director of the maritime authority, Jean-Edmond Randrianantenaina, said.
He said the two men had "been separated at sea. They were not together".
Gellé, who was rescued by locals, said in a video posted on social media: "I'm not going to die yet, thanks to God" and "to the villagers and fishermen of Mahambo".
The minister, a 57-year-old gendarmerie general, said he had "no injuries, only cold".
"I will be able to return to work within 24 hours," he added.
General Ravoavy, who worked with General Gellé for many years, described him as "a military man of character".
"He has always practised sport with great endurance. And he has kept this rhythm even while being a minister, like a 30-year-old. He has a strong morale, he was thrown by the waves and he didn't give up," he said, adding that Gellé had used a seat cushion from the helicopter as a lifeline.
The helicopter was heading for Antseraka, a small town off the coast of which a ship sank on Monday morning with 130 people on board, 45 of whom were rescued.
On Tuesday morning, the death toll stood at 21 passengers, but in the afternoon, the boat washed ashore and 18 more bodies were discovered, bringing the death toll to 39, according to Gendarmerie General Zafisambatra Ravoavy.
The search was continuing for nearly 50 missing people.