John Greyson and Dr. Tarek Loubani, the two Canadian men who spent seven weeks detained without charges in a Cairo prison, are finally free to leave Egypt.

Egyptian officials have agreed to let the pair go after the men were barred from boarding a flight to Germany earlier this week.

Badr Abdel-Atty, a spokesperson for Egypt's foreign ministry, told The Associated Press that the prosecutor has decided to cross out the Canadians’ names from a no-fly list.

"The prosecutor general has informed us that they are free to leave the country after the accusations against them were dropped," Abdel-Atty said.

Greyson and Loubani are planning to fly into Toronto’s Pearson International Airport on Friday, and are expected to make a public statement on their return to Canada.

The two men were arrested on Aug. 16, but never charged with any crimes. After seven weeks in Cairo's notorious Tora prison, they were released on the weekend.

Greyson, a Toronto filmmaker, and Loubani, a London, Ont., physician, were arrested after they stopped to help the injured at a violent protest in Cairo.

The men said they were just passing through Egypt on their way to Gaza, but were accused of participating in the protest alongside members of the Muslim Brotherhood.

Toward the end of their detention, the men described awful conditions in the Tora prison, saying at one point they were forced to share a jail cell with dozens of others, and sleep with cockroaches on a concrete floor.

After their release, Greyson and Loubani attempted to board a flight to Frankfurt, but were told that their names were on a no-fly list.

Greyson’s sister, Cecilia Greyson, blamed the holdup on slow-moving Egyptian bureaucracy. 

Greyson and Loubani appeared in a video posted to YouTube by Cecilia on Wednesday.

In their message, the men thanked their families and supporters.

They’ve been staying at an undisclosed location in Cairo.