An Egyptian aviation student in California who made a threatening Facebook post toward U.S. Republican presidential candidate Donald Trump has agreed to leave the country and could be gone by the end of the week, his attorney said on Monday.

Emadeldin Elsayed, 23, was taken into custody by U.S. Customs and Immigration Enforcement (ICE) in February and his attorney, Hani Bushra, told Reuters that a judge granted Elsayed's request to voluntarily leave the country instead of fight the case in court last Friday.

"I wouldn't be surprised if it's before the end of this week," Bushra said when asked how soon Elsayed may return to his native Cairo. "I think our government really wants this to move quickly."

RELATED: The secret behind Trump's speeches: Enthymemes

ICE spokeswoman Lori Haley said on Monday that Elsayed was still in custody and officials were arranging his repatriation. The agency said he would be escorted by immigration agents on his flight back to Egypt.

Bushra said Elsayed on Feb. 3 posted an article about the Republican frontrunner on Facebook along with a comment reading: "I literally don't mind taking a lifetime sentence in jail for killing this guy. I would actually be doing the whole world a favor."

Bushra said the Secret Service interviewed Elsayed the very next day, and that he had his property and phone searched before his arrest nine days later.

Bushra said he doubted the government considered Elsayed an actual threat, as he was flying planes and taking classes at Universal Air Academy for more than a week after he was first interviewed.

RELATED: Rivals promise to support Trump

Bushra said the U.S. Attorney for Southern California decided against bringing criminal charges against Elsayed, who moved to the country last September and was living in the Los Angeles-area city of El Monte.

The government did however revoke Elsayed's visa and directed the owner of the flight school he attended to revoke his enrollment there as well, Bushra said.

Donald Trump, who maintains a healthy lead over his Republican rivals for president, sparked global backlash last year after calling for a ban against Muslims from entering the United States.