MANILA (Reuters) - Al Qaeda-linked Islamist militants in the Philippines released two German hostages on Friday, after saying they would behead one of them if their demands were not met.

Soldiers ride in a truck as they patrol a road in Jolo, Sulu, in southern Philippines September 25, 2014. Al-Qaeda linked militants in the southern Philippines have threatened to kill two Germans hostages they have been holding since April unless Germany stops supporting U.S. action against Islamic State militants, the SITE monitoring service said. REUTERS/Stringer

The hostages, captured by the Abu Sayyaf group in April from a yacht on the high seas, had been held on the remote island of Jolo, 600 miles (960 km) south of Manila and a hotbed of Islamist militancy in the mainly Roman Catholic nation.

“The hostages, Dr. Stefan Viktor Okonek and (Henrike) Dielen were released in Patikul at around 8.50 p.m. and reached the brigade headquarters at Busbos around 9:20 p.m. for (a) medical check up,” said a text message from Brigadier General Charlie Galvez, deputy commander of Western Mindanao Command.

“The kidnap victims will proceed to Zamboanga City, taking a navy ship.”

The police said local residents had found the Germans walking outside Patikul town and brought them to the nearest police checkpoint, from where they were taken to the army base.

Officials said that they would stay the night in the southern city of Zamboanga before flying to the capital Manila on Saturday morning.

The German foreign ministry thanked the Philippine government for its “close and trusting cooperation”.

“We are relieved to be able to confirm that both Germans are no longer in the hands of their kidnappers,” a spokeswoman said. “Both Germans are now in the care of staff of the embassy in Manila.”

Okonek, a doctor in his early 70s, had told commercial radio in the Philippines earlier in the week that he was being held in a hole in the ground which his captors had told him would be his grave if ransom demands were not met.

Dielen, the other captive, is in her mid-50s.

REBELS SAY RANSOM PAID

Before officials confirmed the release, Abu Rami, the spokesman for the small but violent Abu Sayyaf group, had told a radio station based in Zamboanga that the hostages had been freed.

The rebels had demanded a 250 million pesos ($5.6 million) ransom and for Germany to stop supporting U.S.-led air strikes in Syria. They had threatened to kill Okonek on Friday afternoon.

Rami said Abu Sayyaf had received the amount in full.

“The (money) arrived, nothing more, nothing less,” he said.

Philippines officials did not comment on his claim.

In a separate hostage incident in August, a German foreign ministry spokesman said that “no state money” was paid after a German citizen was freed by Islamist militants in Syria having being held captive for about a year.

The German government was not open to blackmail, the spokesman had said in August.

German government sources told Reuters that Foreign Minister Frank-Walter Steinmeier had sent a special envoy to the Philippines to negotiate a deal with the rebels. The envoy, Ruediger Koenig, arrived in Manila on Thursday evening.

The rebels have a record of kidnappings, killings and bombings.

Some Muslim groups in the southern Philippines have long been fighting Manila’s rule, but Abu Sayyaf rose to prominence in 2000 after kidnapping 21 tourists and workers from a dive resort in nearby Malaysia.