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

A Kansas chemistry teacher whose arrest and attempted deportation by immigration agents fueled national outrage over the Trump administration's treatment of immigrants has been freed — at least for now.

A U.S. District Court judge in Kansas City on Tuesday ordered the release of the teacher, Syed Ahmed Jamal, from jail while the father of three awaits a decision from an immigration board on his case.

Syed Ahmed Jamal, seen with his three kids, was arrested the lawn of his Kansas home on Jan. 24. Courtesy of Jamal family

It's a major legal victory for Jamal, 55, whose plight drew national attention after he was arrested on Jan. 24 by Immigration and Customs Enforcement agents on the front lawn of his Lawrence, Kansas, home as he was about to take his daughter to school.

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

Dozens of Jamal's supporters inside the Charles Evans Whittaker Courthouse in downtown Kansas City applauded as the ruling was announced, NBC affiliate KSHB reported.

"It was a very joyous moment when the judge accepted our legal argument," Jamal's brother, Syed Hussain Jamal, told NBC News. "It’s been a very difficult for my niece and nephews, and I’m just happy that they have their dad back. Everybody's so excited."

The brother said the family is planning a small party Wednesday to celebrate.

Jamal had remained in the United States since initially arriving legally on an international student visa in the 1980s. After pursuing degrees in science and engineering, he graduated to a H1-B visa for highly skilled workers, Jeffrey Bennett, a former lawyer for the family, previously told NBC News.

But by the time of his arrest, Jamal had overstayed a voluntary departure notice — though he had been granted the right to stay in the country under supervision as he continued the long process of applying for U.S. citizenship through legal channels, according to Bennet.

Immigration officials had attempted to deport Jamal, but he's remained behind bars since the Board of Immigration Appeals granted him a stay of deportation in mid-February.

"On March 20, 2018, a U.S. District Court Judge ordered ICE to release of Syed Jamal from custody while his motion to reopen his case is pending before the Board of Immigration Appeals (BIA). ICE is complying with this District Court order," agency spokesman Shawn Neudauer said in a statement emailed to NBC News. "However, Jamal still has an order of removal (deportation order), issued by a federal immigration judge, and should the BIA deny his motion, ICE will carry out the removal order.”

But the family seems optimistic it won't come to that.

"We’re hoping this ruling will bring attention to a lot of the other people in similar situations," said Syed Hussain Jamal, the brother. "A lot of others don’t have the resources that my family had to fight this."