An immigration judge has ordered the deportation of Rafael Rubio, the Venezuelan staffer for the New York City Council who was detained earlier this year at an immigration appointment in Bethpage, the council speaker’s office said Wednesday.

The ruling, by an immigration judge, appears to hinge on a “technical error” that is “related to his asylum application,” the speaker, Julie Menin, said Wednesday in a statement.

A separate proceeding, in Manhattan federal court via habeas corpus, is pending to challenge Rubio’s detention and deportation.

Rubio, a 45-year-old data analyst for the council, has been detained since Jan. 12, when he was detained at what was scheduled to be an asylum interview at a nondescript office building on Stewart Avenue in Bethpage.

Rubio, who argues that he is fleeing persecution in his native Venezuela, is one of hundreds of thousands of foreign nationals from whom President Donald Trump is trying to strip Temporary Protected Status and any work authorization. The Trump administration has also moved to terminate the status for immigrants from Haiti, Yemen, Somalia, Myanmar, Honduras and elsewhere.

A key issue is whether Rubio has a valid TPS status. Rubio’s lawyers say he does, citing paperwork he previously filed as well as a favorable California case, but the Trump administration argues otherwise, including by noting that Trump terminated the TPS program.

The immigration judge who issued the deportation order, Charles Conroy, had previously declined to release Rubio, saying he failed to show he’s not a “danger to society.”

Last month, Conroy, who has one of the city’s lowest rates of granting asylum, sided with a government lawyer, who cited Rubio’s previously dismissed criminal case involving a dispute with his roommate.

Menin’s statement Wednesday said Conroy’s order would be appealed, and she called for Rubio to be released pending the appeals process.

“We are outraged and will continue to pursue every legal avenue to secure his release and ensure his case is properly heard on appeal,” her statement said.

Rubio’s lawyer couldn’t be immediately reached for comment.

Matthew Chayes

Matthew Chayes, a Newsday reporter since 2007, covers New York City.