Egyptian American Aya Hijazi and her husband, Mohamed Hassanein, are co-founders of the Belady Foundation. (Mohamed Abd El Ghany/Reuters)

An Egyptian court on Saturday acquitted a U.S. charity worker who had spent almost three years in pretrial detention for her work with an organization helping street children.

Police arrested Aya Hijazi, her husband and six others in May 2014 on charges of abusing children in her care and engaging in human trafficking, kidnapping, sexual exploitation and torture.

Human rights groups said the charges were fabricated. Hijazi’s detention came as part of a broader crackdown that has neutered independent civil society in Egypt.

The acquittal comes about two weeks after President Trump met Egyptian President Abdel Fatah al-Sissi in Washington, the strongman’s first visit to the United States since he came to power in a 2013 military coup.

[With visit by Egypt’s Sissi, Trump administration signals sharp policy shift]

On Saturday, the Cairo Criminal Court dropped all charges against Hijazi and her co-defendants and ordered their release. As Judge Mohamed el-Feqqi read his verdict aloud, the courtroom erupted. Dressed in white prison uniforms, Hijazi and her husband, Mohammed Hassanein, embraced inside the defendants’ cage as friends and family cried, cheered and chanted for joy.

“They were singing, ‘The sun of freedom has risen,’ ” said Tarek Hussein, an activist who attended the hearing.

Hijazi, an Egyptian American, and Hassanein, an Egyptian citizen, are co-founders of the Belady Foundation, which provided services for Cairo street children. Police raided the organization’s premises in May 2014, also detaining a cook, an artist who shared the premises and the children present at the time.

A forensic report by the public prosecutor later found no evidence that any of the foundation’s children had been sexually abused.

Democratic presidential nominee Hillary Clinton and several U.S. lawmakers had spoken out about the case.

[My sister has been jailed in Egypt for 900 days. When will the U.S. help free her?]

Lawyers said Saturday that the state’s witnesses had offered contradictory and inadequate evidence against the defendants. “Even the child and his mother testified at court in defense of Aya and the others,” said Taher Abol Nasr, Hijazi’s attorney, referring to a child whom state prosecutors alleged the group had kidnapped.

Tens of thousands of Egyptians have been detained by security forces or have disappeared since Sissi led a putsch against Islamist President Mohamed Morsi in summer 2013.

State officials depict the crackdown as part of a war against Islamist extremists who threaten to destroy the country. Human rights groups and activists say the dragnet has extended to dissidents of all political persuasions.

The Trump administration has proposed massive cuts to U.S. foreign aid, but the White House has said it expects that the $1.3 billion in U.S. military aid to Egypt will continue.

“You have a great friend and ally in the United States and in me,” Trump told Sissi during their meeting at the Oval Office.

[State Department’s 28 percent cuts hit foreign aid, U.N. and climate change]

Nongovernmental organizations in Egypt have faced growing pressure since late 2011, when authorities raided 17 pro-democracy and rights groups, accusing them of joining an international conspiracy against the country.

During Sissi’s presidency, that pressure has accelerated, and representatives of many of the country’s leading human rights groups have been arrested, subjected to travel bans or had their assets frozen.

“Aya Hijazi, her husband, and their colleagues are finally free, but the system that subjected them to a travesty of justice for nearly three years remains unchanged,” said Joe Stork, deputy Middle East director at Human Rights Watch.

Shouting above the din from his courtroom cage Saturday, Hassanein vowed to continue their charity work. “We promised the children they won’t return to the streets again, and this promise was hindered for three years. We will return and meet that promise,” he said.

Loveluck reported from Beirut.

Read more:

What Trump should ask a brutal dictator as he welcomes him to the White House

Christians flee Sinai Peninsula in fear of Egypt’s Islamic State affiliate

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news