A federal judge Wednesday temporarily stopped the deportation of a father of two from China who was taken into custody by immigration agents on the day of what was supposed to be his green card interview.

The order, signed by Judge Analisa Torres of the Southern District of New York, also called for 39-year-old Xiu Qing You to be released immediately from the Bergen County Jail, a federal detention facility in New Jersey, where he had been held since late May.

You’s attorney, Yee Ling Poon, and a spokesperson for The Legal Aid Society, which joined the case as You’s co-counsel this week, said in emails that You had left the detention facility as of late Wednesday night. He was picked up by his wife, Yu Mei Chen.

The temporary stay of removal was granted until his case is resolved.

“Today’s ruling is a sharp rebuke of ICE’s cruel and fanatical crusade to circumvent due process with the goal of tearing families apart,” said Gregory Copeland, supervising attorney in the immigration law unit at The Legal Aid Society.

U.S. Immigration Customs and Enforcement (ICE) did not immediately respond to a request for comment Wednesday night.

You’s release comes after stepped up pressure from immigrant rights groups, who rallied for You on Monday, and elected officials including Rep. Grace Meng, D-N.Y., and members of New York’s congressional delegation, who wrote to ICE’s New York field office about the case.

Xiu Qing You, right, his wife Yu Mei Chen and two children. Courtesy Law Office of Yee Ling Poon, LLC

You was arrested by ICE agents on May 23 at what he and his wife thought was supposed to be an interview for a green card.

His arrest, ICE has said, was based on his final order of removal.

You arrived in January 2000 without a valid entry document and ICE began removal proceedings for him in March of that year, according to the agency. That December, an immigration judge ordered him to be removed from the country. His appeal to that decision was turned down that same month.

Poon said You had applied for asylum sometime after entering the U.S. You claimed that he and his girlfriend at that time had conceived a child who “was aborted by the Chinese government because of the fact that they were not married,” according to Poon, who did not represent You at that point.

His asylum claim was denied and an appeal was unsuccessful, Poon added. A removal order was issued in 2002, she said.

You put in a motion to reopen his case in May 2008, but that too was dismissed in September of that year, according to ICE.

Xiu Qing You with his daughter Mia. Courtesy Law Office of Yee Ling Poon, LLC

Meanwhile, as the years ticked by, You built a life in the U.S., meeting his future wife, Chen, in 2006, according to Poon. The two had a traditional Chinese wedding banquet a year later, but didn’t officially register their marriage until around 2013, Poon said.

The couple, who live in Queens, opened a nail salon in Connecticut and had two children, a 6-year-old daughter and a 4-year-old son, Chen said in a previous interview.

Chen became a naturalized U.S. citizen in January 2015, having earlier filed a successful asylum claim because she was forced to have an abortion while in China, according to Poon. You subsequently applied for a green card through his citizen spouse, court papers said.

But the couple never heard back, so they submitted paperwork in federal court asking the government to work on their application, according to Poon. They received a notice dated April 23 saying they’d been granted an interview a month later, court documents said.

At the interview, Chen and You were asked a lot of questions about their marriage, according to Poon, who went with them. Chen was then asked to leave the room, their attorney said.

The officer inquired with You about whether the order of removal was for him since the spelling on that document was different from the name he provided on the application, according to Poon. You affirmed it was the same.

A drawing by Mia, Xiu Qing You 's oldest child. Courtesy Law Office of Yee Ling Poon, LLC

Soon after, ICE agents arrested You, who has no criminal record, and took him to the Bergen County Jail, according to Poon.

Poon said in an interview last week that they were pursuing a number of legal avenues to keep You in the country. That includes filing a stay of removal and a motion with the Board of Immigration Appeals to reopen his asylum proceedings.

Poon said the couple's church wrote a letter on behalf of You stating that he is Roman Catholic. You fears he could be religiously persecuted if deported to China, according to Poon.

Following his release Wednesday night, You and his family plan to spend some quiet time together over the next few days, Poon said, after being separated for nearly a month.

Follow NBC Asian America on Facebook, Twitter, Instagram and Tumblr.