BOSTON — A U.S. immigration judge has ordered a man arrested in Massachusetts during the probe into the failed Times Square bombing deported to his native Pakistan.

The ruling in the case of 27-year-old Aftab Khan was made Thursday by Judge Robin Feder and announced today.

Khan was one of three men arrested on immigration charges May 13 and suspected of supplying money to the primary suspect, Faisal Shahzad. But authorities say the men may not have known how the money would be used.

One of those men is Mohammad Shafiq Rahman, a South Portland, Maine, resident who is in federal custody at Cumberland County Jail on a charge of carrying an expired visa. He faces a hearing on the charge next week in Boston Immigration Court.

Rahman has told people he knew Shahzad several years ago, when both men lived in Connecticut, but they were not friends and he has not spoken with him recently. He has also said he does not know Pir Khan or Aftab Khan, and authorities have not claimed there is any link between them.

Aftab Khan’s lawyer had asked the judge to allow his client to voluntarily leave the country. Federal authorities had asked the judge to keep Khan in the United States.

Aftab Khan says he never heard of Shahzad before his arrest. But federal authorities say Khan had Shahzad’s name in his cell phone and written on an envelope.