TORONTO -- Two Canadians unexpectedly freed from a prison in Egypt over the weekend are expected home by the end of the week, a close relative said Monday, but an Egyptian official said the men's fate remained in the hands of a judge.

In an interview, Cecilia Greyson said her brother John Greyson and Tarek Loubani are doing well and using the delay in dealing with unspecified bureaucratic glitches to acclimatize to their freedom.

"We knew all along that it was going to be at least a few days for them to actually be able to leave Egypt," Greyson told The Canadian Press.

"There is some bureaucracy that the Canadian consular staff in Cairo are working to get through."

Greyson said the pair were released "without conditions" and were in a safe location with consular officials.

However, a spokesman for Egypt's Foreign Affairs Ministry said the men remained under active investigation, and it was far from clear when they might be allowed to leave the country.

"The public prosecutor office and the investigative judge should decide whether they will be tried before a court, or the whole investigation file should be closed and then they'll have the right to go home," Badr Abdelatty told The Canadian Press in a phone interview.

"It's completely up to the judiciary. The investigative judge is the only one who should decide."

Abdelatty said he was unable to say how long it might take for that decision to come down, but said until that happens, the duo would remain free but required to stay within Egypt's borders.

In a statement, a spokeswoman for Lynne Yelich, minister of state for foreign affairs, said the department was working to ensure the duo can leave Egypt.

She offered few details.

"We are aware of possible bureaucratic complications," Adria Minsky said.

"(But) we look forward to seeing these two Canadians return home shortly."

John Greyson, a Toronto filmmaker and Loubani, an emergency room physician from London, Ont., were arrested on Aug. 16 during violent anti-government demonstrations in Cairo and detained in what they've called squalid and oppressive conditions.

Amid mounting pressure for their release, they were suddenly freed early Sunday.

Both have been in direct contact with relatives via email, and Greyson said she had been in touch with them on Monday.

"They're feeling great and healthy and happy and looking forward to coming back to Canada," Greyson said.

"They'll be excited to come back home but it will overwhelming for them to see the amount of media attention and the amount of support."

Citing airport officials, the Associated Press reported Sunday that the pair were prevented from flying out of Cairo after their names appeared on a "stop-list" issued by prosecutors. The men had checked in for a flight to Germany but were not allowed to board the plane.

While the long weekend along with more unrest in Egypt might have added to delay, the "red tape" was not unexpected, Greyson said.

There was no immediate comment from the Department of Foreign Affairs.

Greyson and Loubani had said they planned to stay in the Egyptian capital only briefly on their way to Gaza last month.

They were arrested after leaving the scene of the protests and Egyptian prosecutors later accused them of attacking a police station with members of the Muslim Brotherhood.

At one point during their ordeal, the pair staged a 16-day hunger strike to try to press Egyptian officials to release them.

Prime Minister Stephen Harper welcomed the news of the release of the two Canadians, issuing a statement from the Malaysian capital of Kuala Lumpur where he's continuing a visit aimed at strengthening ties with that Southeast Asian nation.