A judge has revoked the bail of a Pakistani man who is being held at the Cumberland County Jail on an immigration violation while police investigate the attempted car bombing in Times Square.

Pakistan’s consul general in Boston, Barry Hoffman, said he learned today from U.S. Immigration and Customs Enforcement that the judge had revoked the $10,000 bail he had originally set for Mohammad Shafiq Rahman of South Portland. The judge revoked the bail at the urging of the ICE, said Hoffman, pending an investigation into possible criminal charges.

Hoffman said he understood that Rahman has requested a new bail hearing, but a date hasn’t been set. Hoffman did not have further details.

“I’m mystified as to what’s happening. We look at this as a simple immigration case,” said Hoffman. “It’s all confusing, it shows you what’s wrong with our justice system. Our biggest problem is the government is wasting so many resources on people like Rahman, when they should be going after real potential terrorists.”

An ICE spokesman declined to comment, as did Rahman’s wife, Sara Rahman. His attorney, Cynthia Arn, did not return calls for comment.

Mohammad Rahman was one of three Pakistani men who were charged with immigration violations as authorities investigated the attempted Times Square car bombing on May 1.

In the past, Arn has said that Rahman has “no connection” to Faisal Shahzad, who pleaded guilty to 10 terrorism and weapons charges in the Times Square case.

Rahman, a computer programmer, came to the United States legally in 1999, has no criminal record and got married in March. He knew Shahzad when he lived in Connecticut a decade ago because they were both part of the Pakistani community, but they haven’t spoken in years, Arn has said.

Authorities have said that Rahman and two men who were arrested in Massachusetts may have given money to Shahzad through an informal money transfer network but may not have known how the money would be used.

No criminal charges were brought against any of the three men.

Hoffman said Rahman is being held in maximum security at the jail, and is restricted to his cell 23 hours a day. Hoffman said he was told that’s for his own protection, adding “that’s baloney.”

“They’re trying to harass him,” he said. “It’s going to lead to a nervous breakdown.”