A Manhattan federal judge declined Monday to release Rafael Rubio, the immigrant staffer for the New York City Council who was detained in January by immigration agents in Bethpage, ruling that Rubio lacks valid Temporary Protected Status.

The ruling, by Judge John Cronan, was the second setback for Rubio, who is Venezuelan, in less than a week.

In denying Rubio’s habeas corpus petition, which argued that he had been illegally detained, Cronan, a Trump appointee, ruled that Rubio’s lawyer had not sought to make a case against the Trump administration revoking Rubio’s Biden-era Temporary Protected Status, as Trump is seeking to do for nationals of Venezuela and certain other countries. The failure “doomed” the petition, Cronan wrote, along with other reasons it was denied. It is now too late to challenge the legality of the administration’s revocation, the judge wrote.

Rubio’s lawyer argued that his client, 45, has valid TPS status, citing paperwork and a favorable California ruling. Cronan ruled that case doesn’t apply to Rubio.

The judge ruled that Rubio does not have valid TPS. The judge said Rubio has only a receipt confirming that his application for an extension was received — not that his TPS was extended.

Temporary Protected Status is a designation issued by presidential administrations that shields from deportation those whose homelands are deemed too dangerous for a return. The Trump administration is seeking to deport hundreds of thousands of recipients of Temporary Protected Status from countries including Venezuela, Myanmar, Somalia and Honduras.

Last Wednesday, an immigration judge ordered Rubio deported. The City Council says that judge cited a missing signature on an asylum form and refused to let it be corrected.

Rubio and his legal team are challenging his deportation in the two venues under different legal arguments: federal court under the writ of habeas corpus before an independent judge; and immigration court, where the judges are employees of the executive branch and are not fully independent.

Rubio, 45, was detained Jan. 12 when he came to a nondescript Bethpage office for what he thought was an asylum interview. Rubio had worked legally for the Council since last year as a data analyst.

His lawyer couldn’t be immediately reached for comment.

Matthew Chayes

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