Two German hostages have been freed by the Abu Sayyaf group in the southern Philippines, the Philippines military and the group have said, on the day the group had threatened to kill one of them.

The AP news agency on Friday quoted the Philippine defence secretary, Voltaire Gazmin, as saying the group had released Stefan Okonek, 71, and Henrite Dielen, in her 50s.

An Abu Sayyaf spokesman told a local radio station that they had been freed after the payment of a ransom of $5.6m.

The rebels had demanded the ransom and for Germany to stop supporting US-led air strikes in Syria, and had threatened to kill Okonek on Friday if their demands were not met.

Gamzin said he was "not privy" to information about a ransom payment. 

Al Jazeera's Harry Fawcett, reporting from Zamboanga City, said the release came after a day of tense negotiations involving a former German ambassador.

Germany's foreign ministry has confirmed that the hostages had arrived at its embassy in Manila, according to the AFP news agency.

"We are relieved to confirm that the two Germans are no longer in the hands of their kidnappers. They are being taken care of at the embassy in Manila. We  thank the government of the Philippines for their close collaboration, undertaken with full confidence," said a spokesman.

The Germans were seized in April when their yacht broke down near the southern island of Palawan en route to Sabah in eastern Malaysia.

They were being held on Jolo island, a separatist stronghold, in the south of the Philippines.

A video released on Wednesday showed Okonek being held in a hole in the ground, which he had been told would be his grave if his ransom was not paid.

Source: Al Jazeera and agencies