Canadian journalist Mohamed Fahmy has been released on bail from an Egyptian prison.

Judge Hassan Farid ordered on Thursday that Fahmy and his Egyptian Al Jazeera colleague Baher Mohammed be released until a retrial resumes on Feb. 23. Hours later, Fahmy’s brother, Adel Fahmy, posted on Twitter that he had been freed.

Prison officials contacted Adel Fahmy in the middle of the night, and told him to pick up his brother at a local police station, CTV’s Daniele Hamamdjian reported from Cairo.

Fahmy was taken to his parents’ home, where he is spending his first night of freedom after 411 days behind bars.

The judge has ordered that the defendants report to their local police station each day, and that they remain in their “hometowns.”

Fahmy was ordered to post bail amounting to US$33,000 while Mohammed was not required to post bail.

Amal Clooney, his London-based lawyer, released a statement Thursday saying she was encouraged by the granting of bail.

“At the same time, 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,” she added.

“It may also take several months to complete.”

Clooney said there “is no impediment to (Fahmy’s) immediate transfer to Canada and Prime Minister Harper should personally intervene.”

Fahmy, Mohammed and their Australian colleague Peter Greste were arrested on Dec. 29, 2013, tried and given lengthy jail sentences over allegations that they had conspired with the Muslim Brotherhood, which the Egyptian government has deemed a terror organization.

Human rights organizations and legal experts have dismissed their trial as a sham because it included, among other things, manufactured evidence.

Clooney and Fahmy’s family have criticized Canada’s handling of the case.

They evoke Greste’s situation, in which Australian Prime Minister Tony Abbott repeatedly called Egypt’s president to advocate for his release.

Greste was released and deported two weeks ago under a new Egyptian law that allows foreign nationals who have been found guilty of crimes in Egypt to be ousted from the country. Fahmy, who had been a dual citizen, had renounced his Egyptian citizenship under the belief that he, too, would be deported.

Asked about the case on Thursday, Prime Minister Stephen Harper said Fahmy’s case is “not legally identical” to Greste’s, but that the federal government “including my level” has engaged the Egyptians “and will continue to press for his release.”

Last week, then-foreign affairs minister John Baird had said that Fahmy’s release was “imminent.”

However, on Sunday, the Egyptian government ordered that he be retried.

Nadia Abu-Zahra, an assistant professor at the University of Ottawa’s School of International Development and Global Studies, said Baird’s comments in Egypt may be to blame.

“There was a public statement made by our former foreign affairs minister in Cairo,” she said. “He said publicly that if Fahmy was deported to Canada, he would not face a retrial here. That statement put Egypt in an embarrassing situation and possibly may have brought about the retrial.”

Abu-Zahra also said she believes Fahmy’s citizenship was revoked at the request of Egypt’s president, who may be motivated by the bad press his country has received.

“It draws attention to the tens of thousands of other prisoners held in Egyptian prisons and that is unwanted attention,” she said. “The longer Fahmy stays the more attention.”

Earlier, Canada’s Minister of State for Consular Affairs Lynne Yelich issued a statement to say that the government welcomed Fahmy’s release on bail, but “we continue to call for his immediate and full release.”

Yelich added that Canadian officials have discussed his case with their Egyptian counterparts “19 times in the last two weeks.”

On Thursday, Fahmy appeared in court wearing a winter jacket and a sling holding up one arm due to a shoulder injury.

"I didn't ask to give up my Egyptian citizenship. I was asked to do so," Fahmy told the courtroom.

He said Egyptian security officials had asked him to renounce his Egyptian citizenship because his case had become a "nightmare" for Egypt and an official told him "citizenship is not a piece of paper. It is in the heart."

Fahmy then repeated Baird’s words that he had been told his release was imminent.

"We packed up our luggage. My fiancee quit. We booked tickets,” he said.

Fahmy then briefly held up an Egyptian flag.

Earlier Thursday, Fahmy’s family expressed joy and relief at the judge’s decision.

“I was very happy, I was speechless,” Fahmy’s fiancée, Marwa Omara, told CTV News Channel in a telephone interview from Cairo.

“I had mixed feelings, I was crying. I felt the pain of the whole year.”

Fahmy’s release is “a dream,” she said, but “is not a full victory.”

“We still want to see him out completely, and we want to see him in Canada.”

She said Fahmy had shown her pictures of Vancouver, where they hope to hold their wedding and make their home.

Fahmy’s brother, Adel Fahmy, told reporters that he could not describe his feelings in words.

“I’m just really ecstatic and the whole family is bursting with joy that this whole mess is over finally.”

With files from The Associated Press

Mohamed Fahmy's fiance

From CTV News correspondent Daniele Hamamdjian in Cairo: The moment Mohamed Fahmy's fiancee found out he had been released on bail

Mohamed Fahmy in court

From CTV News correspondent Daniele Hamamdjian in Cairo: It's hard to tell, but that's a shot of caged Canadian journalist Mohamed Fahmy in court

CTV News in Cairo, Egypt

From CTV News correspondent Daniele Hamamdjian in Cairo: Media gather in the Cairo court