Egypt's release of Australian journalist Peter Greste removes a stumbling block for President Abdel Fatah al-Sisi as he seeks to shore up international support following a widely condemned crackdown on the opposition.
Secret police raided a Cairo hotel room used by Greste and fellow Al-Jazeera journalists Mohamed Fahmy and Baher Mohamed in December 2013, setting off a nightmare for the journalists and a public relations disaster for the government.
On Sunday, Greste was spirited from his prison cell onto a Cyprus-bound plane, as Egypt prepares for an economic donor conference in March, smoothing over a main bone of contention with its Western allies.
Fahmy, a Canadian-Egyptian, is expected to be released within days, his fiance Marwa Omara told AFP.
A court had sentenced the three to up to 10 years in prison for aiding blacklisted Muslim Brotherhood, which Sisi had removed from power in July 2013, before an appeals court ordered a retrial in January.
Their arrests came against the backdrop of a crackdown on supporters of ousted president Mohamed Morsi that has killed hundreds, and a cold war between Egypt and Qatar, which owns Al-Jazeera and backed Morsi's Muslim Brotherhood.
But the case spiralled into a global campaign for their release, with Washington and the United Nations leading the charge while journalists held rallies in several countries demanding the trio's freedom.
"They didn't want to talk about it anymore, they didn't want to explain it anymore," said a Western diplomat on Sisi's decision to deport Greste on Sunday.
Sisi, who had publicly said he wished they had been deported from the start and never been tried in the first place, "was sick of it," said the diplomat.
"He wants to move beyond this matter and not have it as a focus."
Greste's release came less than two months after Cairo reconciled with Doha, which shut down Al-Jazeera's pro-Brotherhood Egyptian affiliate.
Signup to our newsletter and follow us on Facebook and Twitter!
Greste, Fahmy and Mohamed work for Al-Jazeera's English channel, which operated separately from the Egyptian channel Al-Jazeera Mubashir Masr.
But the prosecution made no distinction between the channels during the trial.
-'Qatar was on trial'-
"Egypt was trying Qatar & AJ, not 3 human beings with families literally dreaming of their freedom," Fahmy wrote on Twitter at one point.
Even without a detente with Qatar, Sisi appeared set on releasing Greste and Fahmy amid pressure from Canada and Australia, where the two journalists had become a cause celebre.
"Clearly the Sisi regime has been wanting to get rid of what has become a public relations problem," said Issandr El Amrani, the North Africa director of the International Crisis Group.
In November, Sisi enacted a decree that appeared tailored for Greste and Fahmy, but not Mohamed: foreigners on trial, or convicted in Egypt, could be deported to their home countries to stand trial or serve out their sentences.
Both Australia and Canada have made clear they will not place Greste and Fahmy on trial.
But the decree's wording was aimed more at avoiding the impression in Egypt that the two had been released under international pressure.
"This has been in the works for several months with the adoption of laws and procedures that would allow for the extradition of foreign convicts in Egypt," El Amrani said.
Mohamed, however, appears set to face a retrial. Sisi's administration has said he will not issue any pardons until the courts have completed their work.
And Egypt is still holding several other reporters behind bars.