Israel will soon release two Jordanians held without charge for more than two months, the two countries have announced, bringing to an end a bitter diplomatic dispute that had resulted in Amman recalling its envoy to Israel.
Ayman Safadi, Jordan's foreign minister, said on Monday that Hiba al-Labadi, 24, and Abdul Rahman Miri, 29, will return home "before the end of the week".
"The government pursued the case from the start under direct instructions from His Majesty King Abdullah to take all necessary steps to release them whatever that may cost," Safadi said in a Twitter post.
He gave no further details.
Israeli Prime Minister Benjamin Netanyahu's office said the handover was agreed after talks between Israeli and Jordanian security chiefs. It said Jordan's ambassador, who was recalled on Tuesday, would return to his post "in the coming days".
Israel arrested al-Labadi on August 20 and Miri on September 2 as they entered the West Bank from Jordan through an Israeli-controlled crossing.
They are being held in administrative detention, an Israeli policy that allows for open-ended detentions without filing charges.
Israel's deputy foreign minister, Tzipi Hotovely, said last week the two were suspected of security offences, without being more specific.
Al-Labadi, who was arrested after crossing to the West Bank to attend a family wedding, has been on hunger strike for a month to protest her detention.
According to her lawyer, Jawad Boulos, al-Labadi was interrogated for 16 days straight without being allowed to see a lawyer.
Boulos, who has since visited al-Labadi in prison, said the interrogations lasted hours while she was handcuffed to a chair. The interrogators, Boulos told Israeli local media, cursed and spit at al-Labadi, and threatened to arrest her sister and mother.
"All the means of torture and oppression were used to force her to sign a damning confession," Boulos said. "But despite the cruel investigation, she did not confess."
Israel's prison service said on Monday that al-Labadi had ended her hunger strike.
Miri, 29, was also arrested as he crossed into the West Bank to visit relatives. He has suffered from brain cancer since 2010, and has undergone several surgeries.
Safadi said last month he held the Israeli government responsible for the lives of the two, adding that their health had severely deteriorated and warned the kingdom could escalate its actions if they were not released.
In announcing the decision to release Labadi and Miri, the Israeli statement said Israel viewed its relations with Jordan as "a cornerstone of stability in the Middle East".
The two countries signed a peace treaty in 1994. The 25th anniversary of the agreement is this month.