Two Germans freed after being held for six months in the southern Philippines by a militant group that threatened to behead one of them if ransom was not paid were flown to Manila on Saturday under the care of their embassy, a Philippine military spokesman said.

Following their release Friday, Stefan Okonek and Henrike Dielen were flown to Manila under arrangements made by the German Embassy, said Maj. Gen. Domingo Tutaan. The two have not spoken publicly about their ordeal and German diplomats could not be reached for comment.

Philippine Defense Secretary Voltaire Gazmin confirmed their released late Friday, just hours after the Abu Sayyaf militant group had threatened to behead Okonek.

Abu Sayyaf spokesman Abu Rami told radio station DXRZ in southern Zamboanga City that his group received 250 million pesos ($5.6 million) in ransom. He did not say who paid it.

Gazmin said he was "not privy" to information about any ransom payment, though other Philippine officials confirmed that ransom had been paid.

"We're happy they're safe. I hope there will be no more (kidnappings)," Gazmin told The Associated Press by phone.

The German Foreign Ministry thanked the Philippine government for its "close and trustful cooperation," but did not give details on how the release came about.

Herminio Coloma, a spokesman for Philippine President Benigno Aquino III, said officials were still trying to piece together details of the release. He said there was "no change in the 'no ransom' policy of the government."

"With the release from captivity of the two German nationals, our security forces will continue efforts to stem the tide of criminality perpetrated by bandit elements," Coloma said in a statement.

Tutaan said Okonek and Dielen were brought by a Philippine navy ship to southern Zamboanga City after their release and spent the night at a military hospital there.

Military officials and government agents monitoring the hostage crisis, who spoke on condition of anonymity because they were not authorized to speak to the media, said the amount of ransom that was paid ranged from $112,000 to $5.4 million.

One of the officials said that Okonek appeared to have been beaten up by his captors because he had a black eye. In a video earlier released by the Abu Sayyaf, he was shown being roughed up and slapped.

Abu Sayyaf gunmen seized Okonek and Dielen from a yacht in April between Malaysia's Sabah state on Borneo Island and the western Philippine province of Palawan. They were taken by boat to predominantly Muslim Sulu province, about 950 kilometers (590 miles) south of Manila, where militants are holding other hostages.

Abu Rami had threatened to behead Okonek at 3 p.m. Friday, but extended the deadline for the ransom payment. The group also had demanded the withdrawal of German support for the U.S.-led air strikes against the Islamic State in Syria and Iraq.

In a call to the Zamboanga radio station, Rami said Okonek and Dielen were released around 8:45 p.m. Friday to a negotiator in a village in Patikul township on Jolo Island, an Abu Sayyaf stronghold.

"The 250 million pesos arrived, no more, no less," he said.

In an interview with DXRZ allowed by the militants earlier in the week, Okonek, 71, who said he was a medical doctor, appealed to "please do everything to get us out of here."

"I hope you will negotiate my release and so with my wife," he said, addressing no one in particular.

He said he was speaking from inside a 15-foot by 10-foot "grave" the gunmen have dug for him in the jungle. He said he and Dielen were separated by the militants about a day before.

Military chief of staff Gen. Gregorio Catapang said the Abu Sayyaf is still holding more than a dozen other Filipino and foreign hostages, including two European birdwatchers who were kidnapped two years ago.

The kidnappings dramatize the threats still posed by the Abu Sayyaf despite more than a decade of U.S.-backed Philippine military offensives that has crippled the group. Their ransom kidnappings have alarmed nearby countries like Malaysia.

In 2000, Abu Sayyaf gunmen snatched 21 European tourists, including three Germans, and Malaysian and Filipino workers from Malaysia's Sipadan diving resort and brought them to Sulu, where they eventually were freed in exchange for large ransom payments.