The Foreign Office said it had been “a long-standing priority under successive governments” to work for Mr Abd El Fattah’s release.

The 44-year-old was convicted in 2021 of “spreading fake news” in Egypt for sharing a Facebook post about torture in the country following a trial that human rights groups said was grossly unfair.

He was granted British citizenship in December 2021 through his London-born mother, when the Conservatives were in power.

Shadow home secretary Chris Philp, who was an immigration minister until September 2021, said he was not aware of Mr Abd El Fattah’s tweets at that time, but he now believed the activist “should have his citizenship revoked”.

“There is no excuse for what he wrote,” Philp told the Today programme on Monday.

On the same programme, Labour’s Dame Emily Thornberry, who chairs the Foreign Affairs committee, accused Philp of “throwing ideas around that were just not based in law”.

“The bottom and top of it is that he [Mr Abd El Fattah] is a British citizen,” she said.

“He was entitled to British citizenship, he claimed it, so he is a British citizen. The British government has been doing their utmost to get him back into the country and out of jail.”

A government source said Mr Abd El Fatteh arrived in the country as a British citizen and there were no legal avenues available to block his entry, even if officials had been aware of his previous social media posts.

It is understood that Downing Street believes there is a high bar to someone having their citizenship revoked because they must have either obtained citizenship by fraud or be deemed to pose a significant national security threat – a test unlikely to be met in this case.

On Monday, the PM’s official spokesman said: “We welcome the return of a British citizen unfairly detained abroad, as we would in all cases and as we have done in the past.”

“That said, it doesn’t change the fact that we have condemned the nature of these historic tweets, and we consider them to be abhorrent, and we’ve been very clear about that.”

A writer and software developer, Mr Abd El Fattah rose to prominence during a 2011 uprising that forced the former Egyptian president, Hosni Mubarak, to resign.

He has spent more than a decade of his life behind bars and his release in September after a presidential pardon followed a long campaign by his family and lobbying by the British government.

In October, he said he was “learning how to get back into life” in an interview with the BBC from Cairo.