A top Pakistani diplomat in New England expects to come to Portland on Friday to meet with Mohammad Shafiq Rahman, the South Portland man who was arrested by federal agents last week for allegedly overstaying his work visa.

Rahman and two Pakistani men from Massachusetts are under investigation for possible financial connections to the attempted Times Square car bombing on May 1. Authorities have said the men may not have known they were supplying funds that supported terrorism.

A computer programmer who recently married a U.S. citizen, Rahman has been held at the Cumberland County Jail since his arrest Thursday.

Barry Hoffman, Pakistan’s consul general in Boston, said his meeting with Rahman is scheduled for 3 p.m. Friday.

Hoffman said he wants to make sure that Rahman is being treated well, and that he does not have any unanswered questions about his legal rights and circumstances.

“The purpose is to find out how he is, does he have any needs,” Hoffman said today.

Hoffman said he is concerned that the public is making assumptions about Rahman, as well as Aftab Khan, 27, and Pir Khan, 43, whom he visited in jail Monday and today, respectively. Both of those men also are being held on immigration violations by U.S. Immigration and Customs Enforcement.

“They are treating it like a very high-profile case, when there have only been immigration violations,” Hoffman said.

“People jump to conclusions (because the men are Pakistani),” he said. “We’re both on the same side of this war against terror.”

Rahman came to the U.S. from Pakistan in 2001 on a non-immigrant work visa, and was employed by a technology firm, Hoffman said. Since then he has apparently lived in New York and Connecticut, and he moved to Maine a few years ago.

Hoffman said Rahman applied for an extension of his visa in 2006, but that application was rejected, and Rahman continued to live in the country without authorization.

Rahman has worked since August as a computer specialist for Artist and Craftsman Supply, a 15-store chain based in Portland. His employer, Larry Adlerstein, has described Rahman as a conscientious worker, and he would welcome him back to the business if Rahman is cleared of any wrongdoing.

Adlerstein said Rahman told him last week that at one point he knew Faisal Shahzad, the man accused of trying to set off a car bomb in Times Square. But Rahman said he had not spoken to Shahzad in several years.

Shahzad, of Bridgeport, Conn., was due in court today in Manhattan for an initial appearance on five felony charges related to the incident.

Hoffman, the consul general, said Aftab Khan and his uncle, Pir Khan, told him they do not know Shahzad and they don’t know why they have been swept up in the investigation.

Hoffman also said he does not believe either of the Massachusetts men know Rahman, the South Portland resident.

Pir Khan’s wife, Rebecca Barry, is from Litchfield, Maine. The couple wed in 2008 in Watertown, Mass. Attempts to reach her today have been unsuccessful. Hoffman said he believes the couple is still married, but she has not visited him at the jail in Plymouth County.

Hoffman was concerned that Pir Khan was being held in maximum security at the Plymouth County House of Corrections, and was brought into an interview room today in leg shackles and handcuffs.

“He has been in the U.S. for 20 years and is married to a U.S. citizen,” Hoffman said. “I was shocked to find out that he was being held in max security. It seems pretty excessive.”

A spokesperson for Immigration and Customs could not be reached for comment immediately.