A Canadian journalist imprisoned for more than a year has been released on bail – but there is no guarantee Mohamed Fahmy's freedom will be long-lived.

A Cairo courtroom erupted in applause on Thursday when a judge said Mr. Fahmy, the local bureau chief for Al Jazeera's English network, could be let go until the next court hearing after the payment of about $41,000 (Canadian).

His family was jubilant, and his brother, Adel Fahmy, quickly handed over the money. Late Thursday night, his brother tweeted that Mr. Fahmy had been released on bail, his first taste of freedom since his arrest on Dec. 29, 2013.

Story continues below advertisement

Baher Mohamed, an Egyptian journalist and colleague of Fahmy's at Al Jazeera, was also released from a police station on bail.

Cairo is keen to avoid appearing to interfere with the country's judicial system. That means that although the government still has the authority to deport Mr. Fahmy, it may wait for his hearing to resume on Feb. 23 in the hopes of a swift acquittal.

But delaying Mr. Fahmy's deportation could be a gamble: Retrial proceedings could drag out, and Mr. Fahmy could be convicted a second time – both possibilities that could further complicate his deportation in the future.

Mr. Fahmy, Mr. Mohamed and Australian reporter Peter Greste were convicted last spring of conspiring with the banned Muslim Brotherhood to spread false news.

Mr. Greste was deported on Feb. 1, but retrials were ordered for Mr. Fahmy and Mr. Mohamed.

The incarceration of the journalists is the focus of an international campaign for press freedom and has become a problem for the government of Egyptian President Abdel Fattah el-Sissi.

Adel Fahmy said it is clear to him the Egyptians are trying to find a way to end the case against the journalists gradually. "They don't want to end it abruptly or suddenly for political reasons," he said.

Story continues below advertisement

But "I think we all have reason to be optimistic that the whole case is falling apart, mainly based on the appeal acceptance reasoning that was released a few days ago showing that the case is completely baseless."

‎Prime Minister Stephen Harper has sent letters to Mr. el-Sissi asking for Mr. Fahmy's release. And Canadian officials raised the case with Egyptian officials 19 times in the past two weeks.

"Our government, for some time now, has been in contact with Egyptian authorities at all levels, including my level," Mr. Harper said on Thursday in Victoriaville, Que. "We will continue to press for his release and we do remain optimistic this case will be resolved."

Mr. Fahmy's family accuses Canada of not pressing the Egyptians to release him with the same force that the Australians exerted for Mr. Greste. They urged Canadians to ask Mr. Harper to call the Egyptian President.

Thursday was the first day of the retrial, and the news of bail came as a surprise. Mr. Fahmy waved an Egyptian flag. His fiancée, Marwa Omara, hugged those next to her and shouted, "Long live justice."

"I am just hoping that Saturday he is with us at home," Adel Fahmy said in an interview with The Globe and Mail. He said his family is ecstatic. "We have waited this long."

Story continues below advertisement

Mr. Mohamed and 11 other defendants, most of them students, were set free until the next court date, Feb. 23. Mr. Fahmy, now the only foreigner in the case, was only the one required to post bail because he is considered a flight risk.

Mr. Mohamed's father, Hazem Mohamed, called for the release of all detained journalists.

"I am of course happy, but my happiness will not be complete until all of the journalists imprisoned in Egypt are released, including those who are not well known," he told The Globe and Mail.

Mr. Fahmy, who came to Canada as a teenager and became a dual citizen of Canada and Egypt, renounced his Egyptian citizenship to qualify for deportation under the special presidential decree used to release Mr. Greste.

Adel Fahmy said his family is still hoping his brother will be deported without having to go through a new criminal proceeding. "And, if not," he said, "we'll just have to wait until the end of the trial and full acquittal, exoneration."

If that happens, Mohamed Fahmy may apply to have his Egyptian citizenship reinstated, his brother said. "The lawyer told us there is a way to reverse it and to rectify this mistake."

Story continues below advertisement

The call for Mr. Fahmy to be deported was echoed on Thursday by Amal Clooney, the internationally renowned human rights lawyer who is working for Mr. Fahmy.

"There is no guarantee that a retrial will be carried out in compliance with international standards or result in the full acquittal on all charges that Fahmy deserves. It may also take several months to complete," she said in a statement.

"So this case is not over yet; but it should be," Ms. Clooney said. "Ten days ago, Mohamed Fahmy and his family celebrated the return of Fahmy's former colleague, Peter Greste, to Australia under the terms of a decree allowing foreign prisoners to be transferred to their home state. Mr Fahmy is eligible for transfer under this same law – and the retrial process that began today does not change that."