The unanimous vote by Israel’s Security Cabinet cleared the way for Ilan Grapel to return home on Thursday, Prime Minister Benjamin Netanyahu’s office said, ending what has become an uncomfortable episode between the two allies.

Grapel, 27, was arrested June 12 during the height of Egypt’s uprising, which ousted President Hosni Mubarak earlier this year.

Egypt accused Grapel of being a Mossad agent trying to sabotage the revolution. But it gave no evidence to support the claims, and even in Egypt, the arrest was widely ridiculed.

In a statement, Netanyahu thanked the US for helping achieve the Grapel deal. Netanyahu also said he was making “every effort” to bring about the release of Ouda Tarabin, a Bedouin Arab citizen of Israel who has been incarcerated by Egypt for over a decade on similar charges.