LOS ANGELES (AP) An Orange County mosque leader from Egypt who had allegedly given speeches that could be considered to support terrorist organizations has left the United States, authorities said.

Wagdy Ghoneim, who was the imam at the Islamic Institute of Orange County, reached an agreement with the U.S. Immigration and Customs Enforcement to depart voluntarily, avoiding deportation in exchange for admitting he was in the country in violation of his immigration status, said agency spokeswoman Virginia Kice.

Ghoneim departed from Los Angeles International Airport early Monday and transferred in New York onto a flight bound for Qatar.

“Many people are extremely sad and disappointed in the system,” said Valerie Curtis-Diop, Ghoneim’s attorney. “They’re apprehensive because, if this can happen to a spiritual leader, they wonder who will be the next target.”

By giving up his two-month immigration fight voluntarily, Ghoneim is eligible to reapply for entry into the country.

Ghoneim, 53, was arrested at his Anaheim home in November on an immigration violation. At the time, his lawyer and supporters said the arrest was a mistake and that he expected to be released soon.

Ghoneim had been held without bond since then “based upon Department of Homeland Security concerns that his past speeches and participation in fund-raising activities could be supportive of terrorist organizations,” Kice said last month, declining to provide details.