BOSTON -- A Pakistani man arrested in Massachusetts during the investigation into the failed Times Square bombing had the primary suspect's phone number and name in his cell phone and written on an envelope, a government attorney said Thursday.

Aftab Khan, a gas station attendant, had the items among his belongings in his Watertown, Mass., apartment, said Richard Neville, deputy chief counsel for U.S. Immigration and Customs Enforcement in Boston.

Neville revealed the information in court Thursday as he tried to persuade a U.S. immigration judge to keep Khan in the United States. His lawyer has asked that Khan be allowed to leave voluntarily. Judge Robin Feder did not immediately rule.

Khan, 27, was one of three Pakistani men arrested on immigration violations in New England last week as federal agents followed the money trail in their investigation into Faisal Shahzad, who is accused of trying to set off a car bomb in Times Square on May 1.

New York prosecutors said in a letter released Thursday that uninterrupted access to Shahzad for two weeks after his May 3 arrest was "extremely beneficial, if not essential" as investigators raced to prevent future attacks and identify other suspects.

More On This...

Khan's cell phone had in its memory Shahzad's Connecticut phone number and first name, Neville said. The envelope also had Shahzad's first name and phone number written on it, he said.

Defense attorney Saher Macarius said earlier Thursday that Khan had never heard of Shahzad before his arrest, and he appeared stunned by the government's courtroom revelations.

"My client denied any relationship with that individual," he said. "He would have told me if he had any connection."

After the hearing, Macarius questioned whether the confiscated cell phone belonged to Khan and noted that the government had not presented evidence that it did.

Khan did not appear in court, but via video link from jail.

He and a relative and roommate, Pir Khan, were arrested last week. A third man, Mohammad Shafiq Rahman, was arrested in Maine.

All three are being held on immigration charges and have not been charged criminally. Federal authorities have said they believe the three funneled funds to Shahzad through an informal money transfer network, but may not have known how it would be used.

Before the hearing Thursday, Macarius said he believes the Pir and Aftab Khan were targeted because they each had booked flights from New York to Pakistan using the same route that Shahzad was planning to fly on the day he was arrested.

Shahzad was taken into custody on a Dubai-bound plane from John F. Kennedy International Airport in New York.

During the hearing, Neville revealed that investigators determined that Khan had moved his flight reservations from June 16 up to May 13, the day he was arrested.

Macarius said Khan may have done so to comply with an immigration regulation that says if someone is in the United States illegally for more than 180 days and leaves, he will not be allowed back for three years. He said Khan planned to return to Pakistan to try to correct his immigration status and wanted to return to the United States.

Macarius also said Aftab Khan had worked for several years for a company that brought food and supplies to a U.S. Army base in Kuwait. Macarius said Khan met an American soldier on the base who agreed to marry him. He said Khan was issued a visa to travel to Colorado for their wedding, but when he arrived last summer, the woman broke off their engagement. In November, Khan married a teacher in Cambridge, Macarius said.

During the hearing, an Immigration and Customs Enforcement agent said the Colorado woman told investigators that she told Khan she didn't want to go through with the wedding, but that Khan visited her at her home in Colorado Springs to try to persuade her to. The woman told investigators that Khan offered her $5,000 to marry him and became "angry and agitated" when she refused.

The ICE agent also said that when investigators interviewed the teacher, she said it was a "fraudulent marriage" that she had agreed to because Khan paid her $1,500 to $2,000.

The letter released by prosecutors in New York on Thursday said hundreds of agents in different cities were working "vigorously and expeditiously pursuing leads" around-the-clock after Shahzad's arrest.

They said the leads were related to information provided by Shahzad, who each day waived in writing his rights to a lawyer and to appear in court.

Shahzad's cooperation enabled federal agents to question him "on a number of sensitive national security and law enforcement matters for the purpose of preventing potential future attacks, identifying associates of the defendant and possible facilitators of the attempted attack, as well as gathering other actionable intelligence," prosecutors wrote

The letter to a chief judge and magistrate was dated May 12 and partially redacted when it was put in the public record Thursday.