Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An Egyptian-American charity worker returned home to the Washington, D.C. area Thursday night after spending three years in an Egyptian jail over what human rights groups say were bogus charges.

A freed Aya Hijazi got the opportunity Friday morning to shake hands with President Donald Trump, who her lawyer said helped to secure her release.

"First and foremost, there have been countless number of people advocating for Aya Hijazi's freedom," Wade McMullen told NBC News. "I think Trump and his team deserve credit for making this a priority at the most critical time in her case."

Aya Hijazi, an Egyptian-American woman detained in Egypt for nearly three years on human trafficking charges, shakes hands with U.S. President Donald Trump in the Oval Office of the White House in Washington, April 21, 2017. Kevin Lamarque / Reuters

Hijazi, 30, and her brother met with Trump at the White House in a visit that included Jared Kushner, Ivanka Trump and Dina Powell, an Egyptian-American and Trump's deputy national security adviser for strategy.

"We are very happy to have Aya Hijazi back home, and it's a great honor to have her in the Oval Office with her brother and thank you very much," the president said with Hijazi smiling beside him.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The breakthrough in Hijazi's case comes after the president earlier this month welcomed Egyptian President Abdel Fattah al-Sisi to the White House. Trump told Sisi: "You have a great friend and ally in the United States and in me." Their meeting apparently set the stage for Hijazi's release.

As the founders of the Belady Foundation, a non-governmental organization that looks after Cairo street children, Hijazi and her husband were arrested in 2014 as part of Sisi's crackdown on those opposing him as well as more liberal and secular activists.

Hijazi was detained for 33 months — far longer than the 24-month maximum allowed under Egyptian law that a person can be held for before trial.

A Cairo court finally acquitted Hijazi Sunday on charges of human trafficking, sexual exploitation of minors and using children in protests — all considered baseless by human rights groups and U.S. officials.

Aya Hijazi, center, a dual U.S.-Egyptian citizen, is acquitted by an Egyptian court after nearly three years of detention over accusations related to running a foundation dedicated to helping street children, Cairo, Sunday, April 16, 2017. Mohamed el Raai / AP

Also released Thursday night were Hijazi's husband, Egyptian national Mohamed Hassanein, and four other humanitarian workers.

The Obama administration had also called for Hijazi's release. But the former president had a tough stance on Sisi, including barring him from the White House over Egypt's human rights policies.

But with the Trump administration resetting relations with Egypt, McMullen said his team worked closely with the White House to negotiate her release.

McMullen added that Egyptian authorities unlawfully arrested Hijazi and her husband, and the couple was detained without even being told what the charges were until months later.

"She was kept in pretty isolating circumstances" and "not even her lawyers can have time with her," McMullen said of Hijazi, who was born in Egypt and grew up in Falls Church, Virginia.

"The prosecution quickly realized they didn’t have enough evidence to substantiate [the charges]," he added.

Despite their long detainment, the couple told their attorney that they won't forsake their charitable causes and are only emboldened to redouble their efforts.

"Just talking with them tonight, their spark is still there to make the world a better place," McMullen said. "Whether it’s street children in Egypt or for any causes, once they’re back on their feet, they’ll be committed and working to make the world a better place."