A judge has granted a chemistry professor from Bangladesh, who is living near Kansas City, a temporary stay from deportation, two weeks after immigration agents arrested him at his home.

Syed Ahmed Jamal has been living and working in the United States for more than 30 years. He is married with three children and was facing deportation as soon as Friday before a judge ordered the stay.

It was unclear how long the temporary stay would be valid, but it's long enough for a court to hear his case.

His family said the stay came as a surprise and gave them hope that the courts could examine his case.

Jamal came to the United States on a student visa in 1987, was granted a separate visa for highly skilled workers, then a student visa when he pursued his doctorate. He had a temporary work permit at the time of his arrest.

Expired visa

An Immigration and Customs Enforcement spokesman told The Washington Post that Jamal's visa expired in 2011 and he was ordered to leave the country.

Immigration agents arrested him, but Obama administration rules allowed him to stay on a temporary work permit because of his skills and contributions to society.

It is unclear why agents arrested Jamal on January 24. ICE said it does not give advance notice of deportation orders for security reasons and could not comment on his case.

But an ICE statement says the agency "does not exempt classes or categories of removable aliens from potential enforcement. All those in violation of the immigration laws may be subject to immigration arrest, detention, and, if found removable by final order, removal from the United States."

President Donald Trump has vowed to deport as many as 3 million undocumented immigrants.

But Jamal's case brought a huge outcry from his friends, neighbors, colleagues and at least one member of Congress from the Kansas City area.

Jamal's brother, Syed, described Jamal to the Post as a U.S.-educated, liberal, secular Muslim who belongs to an Urdu-speaking ethnic minority and could face death at the hands of Islamic extremists if he is sent back to Bangladesh.