A Kansas professor who was detained by immigration agents and facing deportation after living in the United States for 30 years has been granted a temporary stay, his attorney said Thursday.

Syed Ahmed Jamal, a father of three, was about to take his daughter to school on Jan. 24 when U.S. Immigration and Customs Enforcement (ICE) officials showed up on his front lawn in Lawrence, Kansas, and arrested him.

When Jamal's stunned wife tried to hug her husband goodbye, ICE agents stopped her, telling her "that they would arrest her for interference" if she didn't let them take him immediately, his brother, Syed Hussain Jamal, told NBC News earlier this week.

But on Thursday, Rekha Sharma-Crawford, an attorney for Jamal and his family, announced that Jamal had been granted a temporary stay of deportation — meaning he is now allowed to remain in the U.S. while his case is heard by an immigration court.

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

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

"It is a temporary stay, but a stay nonetheless," Sharma-Crawford, who is based in Kansas City, Missouri, said. "The family is very, very relieved."

Jamal, 55, a chemistry professor at Park University in Missouri, entered the U.S. lawfully on an international student visa in the 1980s, according to another lawyer who initially represented the family, Jeffrey Y. Bennett. He has three children — ages 7, 12, and 14 — all of whom are U.S. citizens, and he has no criminal record, other than a speeding ticket that has long been resolved.

A ICE said in a statement confirmed to NBC News that that a "a federal immigration judge granted Syed Ahmed Jamal, 55, from Bangladesh, a temporary stay of removal until the motion to reopen his immigration case is decided."

Jamal has a "long history" of trying to get a path to U.S. citizenship, Bennett added. Throughout the years, he had a handful of student visas while pursuing graduate degrees in science and engineering, and then a H-1B visa for highly skilled workers; at the time of his detainment, he had overstayed a voluntary departure notice, but had been granted permission to stay in the U.S. under supervision.

The family was aware that there was a slight risk that Jamal, who had been given prosecutorial discretion to indefinitely stay in the U.S. under a policy formalized by President Barack Obama, could face deportation. But they never expected it would actually happen; his brother and attorney said Jamal is a beloved community member who was involved in his children's school board and was a respected professor.

Jamal's case made national headlines earlier this week and garnered widespread support.

A Change.org petition had asked ICE for a stay of removal for Jamal had collected more than 58,000 signatures and a GoFundMe had raised more than $37,000 to help the family with legal fees.

His attorney said Jamal has been moved from the Missouri detention center where he had been held to another center in El Paso, Texas.

"Depending on whether there is a court ruling or some other change in the status of what's going on, that will dictate where he is moved closer to family or not," Sharma-Crawford said.