Egypt's president has pardoned jailed rights activist Patrick Zaki and lawyer Mohammed al-Baqer, state media report.
The news comes a day after an emergency court found Mr Zaki guilty of "spreading false news" and sentenced him to three years in prison.
The judgement, based on an article he wrote about his life as a Coptic Christian, was widely condemned.
Mr Baqer represented pro-democracy activist Alaa Abdel Fattah before they were jailed on the same charge in 2021.
Egypt's government has carried out what rights groups have described as a relentless crackdown on any form of dissent since President Abdul Fattah al-Sisi led the military's overthrow of his democratically elected predecessor in 2013. They say tens of thousands of critics have been detained arbitrarily.
The pardons were welcomed by the board of the government's "national dialogue" process and Hossam Bahgat of the Egyptian Initiative for Personal Rights (EIPR), for which Mr Zaki worked while also studying in Italy.
"Baqer and Patrick should not have spent one day in jail for their human rights work," he tweeted. "We welcome the news of their pardon and call for the immediate release of thousands still detained in Egypt on political grounds."
Italy's Prime Minister Giorgia Meloni said in a video message that Mr Zaki would return there on Thursday. She also wished him "a life of serenity and success" and thanked President Sisi "for this very important act".
Her Foreign Minister, Antonio Tajani, declared that Italy's foreign policy had "contributed significantly to the release of this young student".
Mr Zaki's case received widespread public attention in the European country, where he had been pursuing a master's degree in gender and women's studies when he decided to return to Egypt for a short family visit in February 2020.
The 32-year-old was arrested at Cairo's airport before being transferred to his home city of Mansoura. His lawyers allege that he was subjected to torture, including electric shocks, while being interrogated.
Prosecutors eventually charged him with "spreading false news inside and outside of the country", based on an opinion piece published on the Daraj news website in July 2019. The EIPR said the article described his experiences as a Coptic Egyptian and his views on events affecting the religious minority.
In September 2021, after 19 months in detention, Mr Zaki went on trial at the Emergency State Security Court in Mansoura and pleaded not guilty. Three months later, the court ordered his release on bail.
On Tuesday, Mr Bahgat said the court had found him guilty and ordered his immediate reimprisonment, describing it as a "travesty of justice".
Fellow rights activists walked out of the national dialogue in response to the conviction, prompting its board to appeal for a pardon. The US and UN also expressed concern and called for Mr Zaki's immediate release.
Mr Baqer has been detained since September 2019, when he was arrested while attending the interrogation of Alaa Abdel Fattah, a British-Egyptian pro-democracy activist considered the country's best-known political prisoner.
The two men were subsequently charged with "spreading false news undermining national security" along with the blogger Mohammed "Oxygen" Ibrahim. The case was related to their social media posts.
Human rights groups had called the charges spurious and their trial before an emergency state security court in Cairo a sham.
In September 2021, the court found all three men guilty. Alaa Abdel Fattah, a British-Egyptian dual national, was sentenced to five years in prison, while Mr Baqer and Mohammed Ibrahim were handed four-year terms.
After learning of his pardon, Mr Baqer's wife expressed hope that he would be freed in time to celebrate his birthday on Thursday. "Gratitude to everyone who tried, worked, prayed for Baqer and for us," Neama Hisham said.