A South Korean captain and a Filipino crewman abducted by suspected Islamist militants in the southern Philippines three months ago were released on Saturday, the presidential peace adviser said.
Jesus Dureza, a senior aide to President Rodrigo Duterte, fetched the two hostages in Sulu, a remote archipelago known as a militant hideout, and brought them to Davao, a city about 600 kilometres (370 miles) from Sulu.
"We were almost hopeless but I am thankful we were able to come home safely with the help of Sir Dureza and the president for assisting us," Filipino crewman Glenn Alindajao, 31, said in a news briefing.
South Korean captain Park Chung-Hung, 38, did not speak with reporters but like Alindajao, appeared to have grown a beard while in captivity.
In October, the Philippine military said armed men identifying themselves as Abu Sayyaf militants kidnapped the pair from a South Korean cargo ship, the first such attack on a large merchant vessel.
The abduction on board the 11,400-tonne heavy load carrier Dong Bang Giant 2 occurred just off the southern entry of the Sibutu Passage, a 29-kilometre (18-mile) wide channel used by merchant shipping in transit between the Pacific Ocean and the South China Sea.
Dureza said the freed captives would be flown to the capital Manila and undergo debriefing.
He added that the Muslim rebel group Moro National Liberation Front (MNLF), which is in peace talks with the government, helped in facilitating the hostages' release.
Dureza reiterated the government's no ransom policy but the Abu Sayyaf does not normally free hostages unless a ransom is paid.
The Abu Sayyaf is a loose network of militants formed in the 1990s with seed money from Osama bin Laden's Al-Qaeda network, and has earned millions of dollars from kidnappings-for-ransom.
Abu Sayyaf militants beheaded two Canadian hostages last year after demands for millions of dollars were not met, and released a Norwegian man along with a number of Indonesian and Malaysian sailors after ransoms were believed to be paid.
The group began abducting sailors in border waters between Malaysia, Indonesia and the Philippines last year, taking several dozen hostages.
The spike in abductions sparked Indonesian warnings that the region could become the "next Somalia" and pushed the three neighbours to pledge coordinated patrols.
The International Maritime Bureau said this week the number of maritime kidnappings hit a 10-year high in 2016, with waters off the southern Philippines becoming increasingly dangerous.