BERLIN — The Al-Jazeera journalist who was detained in Berlin on an Egyptian arrest warrant has been released from custody, and is free to leave the country, Berlin prosecutors said Monday.

Ahmed Mansour, 52, was detained on Saturday at Berlin's Tegel airport as he tried to board a Qatar Airways flight to Doha. A dual Egyptian-British citizen, he was convicted in absentia in Egypt on charges that his lawyers and reporters' groups call politically motivated.

About two hours after German authorities announced his release, Mansour finally emerged from the justice building where he was being held. He waved to supporters waiting outside, and chanted "God is great" in Arabic.

"I am free now despite el-Sissi," Mansour said into a microphone, referring to Egyptian President Abdel-Fattah el-Sissi. "I thank all the free people in the world."

The crowd chanted "Down, down with military rule."

Berlin prosecutors decided Monday afternoon to free Mansour, after examining details of the Egyptian case and also taking into account "political and diplomatic concerns" as discussed with Berlin state and federal authorities, spokesman Martin Steltner said in a statement.

"After the evaluation, the concerns over agreeing to extradition couldn't be dispelled despite assurances from Egypt," he said.

Steltner couldn't immediately be reached to elaborate, but Foreign Ministry spokesman Martin Schaefer told reporters earlier that while the case was up to judicial authorities to decide, the ministry had regularly spoken out against human rights issues in Egypt and the widespread use of the death penalty and had the option to veto any extradition.

"There will be an intensive examination of the criminal allegations in the light of due process in the Egyptian judicial system, particularly in relation to cases involving the media or to people who are close to the Muslim Brotherhood," Schaefer said.

Following the decision, Mansour's attorney Patrick Teubner said there were no strings attached to his client's release and that there were no further charges or legal matters pending against him in Germany.

"I think that was absolutely the right decision," Teubner told The Associated Press. "There was no other alternative."

Dozens of demonstrators gathered outside the justice building before Mansour was released, carrying signs with slogans including "stop the bloodbath in Egypt" and "freedom for Ahmed Mansour."

After news broke of his release, Al-Jazeera General Manager Yasser Abu Hilala spoke to the broadcaster in a studio in Qatar saying "this is a happy day."

"It is a victory for the freedom of the press in the face of authorities," he said.

German Justice Ministry spokesman Piotr Malachowski said Mansour had been picked up on the basis of a request from Interpol, which had gone through his ministry and the Foreign Ministry and then was routinely passed along to federal police.

Mansour's detention is the latest in a long series of legal entanglements between Egypt and satellite news channels. According to court documents, he was sentenced in absentia to 15 years in prison, alongside two Muslim Brotherhood members and an Islamic preacher, for allegedly torturing a lawyer in Tahrir Square in 2011, a charge both he and the channel rejects.

According to the court verdict, Mansour was accused by witnesses of bringing in journalists to film the tortured lawyer where he was held.

The court ruled that Mansour and the Brotherhood members had been running and operating a detention center in a travel agency office overlooking Tahrir Square, where hundreds of thousands held a sit-in against longtime autocrat Hosni Mubarak in 2011.

An Egyptian prosecutor, speaking on condition of anonymity because he was not authorized to talk with the press, said the arrest warrant invoked the international convention against torture.

Sarah El Deeb in Cairo contributed to this report.