PORTLAND — A Pakistani man who was detained during the investigation of a botched car bombing in New York City’s Times Square says he knew the plotter years ago as a partying college student, not as the radical Muslim who said he got explosives training from the Pakistani Taliban.

Mohammad Shafiq Rahman, a South Portland resident, told The Associated Press on Tuesday that he was a computer programmer working 18-hour days in Connecticut when he met Faisal Shahzad through his employer’s brother.

Rahman, 33, said he and others joined Pakistani students on weekends at Shahzad’s college dorm in Bridgeport, Conn. He recalled Shahzad as a typical student who drank and partied.

Rahman, who last saw Shahzad in 2002, distanced himself from Shahzad and terrorism in his first public remarks since being released from federal detention last week.

“The Taliban are terrorists. They are not Muslim extremists. They are terrorists. Period,” said Rahman, who was joined by his wife, Sara Rahman, in Portland’s Deering Oaks. “It doesn’t come from faith. They’re using the faith, devotion of the faith, and manipulating the faith into wrong.”

Rahman said he harbors no resentment toward federal agents, even the ones who took him at gunpoint. He said he was treated well during 15 weeks of detention, most of which he spent in the Cumberland County Jail. He was released Thursday but still faces an immigration review for overstaying his work visa.

Rahman, 33, was one of three Pakistani men in New England who were taken into custody May 13, during the Times Square investigation. Rahman said he didn’t know the other two men, cousins Pir Khan and Aftab Khan, who were detained in Watertown, Mass.

None of the three has been charged in connection with the Times Square case. Shahzad, a financial analyst and the father of two, pleaded guilty to terrorism and weapons charges after the bombing attempt May 1.

Federal investigators suggested that the other three men may have given money to Shahzad through an informal money transfer network known as a hawala. But Rahman said he used Western Union and banks to wire money to family members and his company’s office in Pakistan. He said he was confident that none of the money was used to support terrorism.

Rahman, son of a Pakistani air force communications engineer, came to the United States in 1999 to work for a software company. He said his work visa was extended twice and he assumed it was extended for a third time, but his former employer apparently neglected the paperwork.

He didn’t realize there was a problem, he said, until armed agents emerged from unmarked SUVs as he parked his car a block from his workplace in Portland. Later, more than a dozen officers searched his family’s apartment in South Portland, said his wife.

A U.S. Immigration and Customs Enforcement official declined to discuss the specifics of Rahman’s arrest, but said the agency’s officers are trained professionals.

“We treat those we arrest humanely,” said Harold Ort. “At the same time, we have to be concerned for officer safety during that arrest process.”

Rahman is now seeking to remain in the U.S. based on his marriage. He and his wife were in a relationship for several years before they married in March.

Sara Rahman is an artist and a granddaughter of the late Gordon Parks, who was a Life magazine photographer and director of the movie “Shaft.”

She’s now supporting the family, including her children, by working for her sister’s lobster company. Her husband’s next immigration hearing is scheduled for Sept. 14.

Sara Rahman said that she knew there was no way her husband was involved in terrorism, and that his calm demeanor helped her to cope.

Before his detention, Mohammad Shafiq Rahman was a computer programmer for Artist & Craftsman Supply, a company with more than a dozen stores from Portland to Los Angeles.

Larry Adlerstein, owner of the Portland-based chain, said he has agreed to hire Rahman back once he puts his immigration problems behind him. Adlerstein, who met with Rahman after his release from federal custody, said he’s impressed by the way Rahman handled his ordeal.

“After what he went through, there was no animosity. There was no anger,” Adlerstein said. “I continue to be impressed with this young man.”