Defense lawyers for a man charged with killing eight people in a New York City terrorist attack said in a court filing Monday that the U.S. had their client under surveillance and perhaps illegally for years.

The lawyers in their partially redacted filing in Manhattan federal court demanded more information from prosecutors about how they knew so much about Sayfullo Saipov after they arrested him immediately after the Oct. 31, 2017 attack.

They said investigators' years-long wiretapping even included a conversation between an individual and Saipov the day before Saipov's arrest.

"The government's allegations strongly suggest the use of various surreptitious surveillance methods in this case," they wrote.

"Mr. Saipov's international electronic communications and other online activities could readily have been vacuumed up by the government's dragnet collection of content and metadata ... either through bulk surveillance or by targeting individuals overseas," the lawyers wrote.

"Any electronic communications he had with possible ISIS agents, members, or sympathizers located overseas (as well as agents, members, and sympathizers of other designated foreign terrorist organizations) were very likely intercepted," they added.

They are demanding more U.S. disclosures to defend Saipov in a case in which prosecutors seek death.

Saipov has pleaded not guilty to charges he drove a truck down a Manhattan bike path on Halloween in 2017, running over cyclists, before crashing his vehicle into a school bus. He was shot by a police officer and arrested at the scene.

Saipov, facing trial next year, moved to the United States legally in 2010 from Uzbekistan. He lived in Ohio and Florida and worked as a commercial truck driver before living with his family in Paterson, New Jersey.

Court papers say that after his arrest, he told authorities he was inspired by an Islamic State group video and that he had used a truck in the attack to inflict maximum damage against civilians.

A spokeswoman for prosecutors declined comment Monday.

Defense lawyers say they suspect the surveillance was swept up using a rule letting communications of U.S. individuals to be monitored overseas.

The lawyers said more information about how the U.S. government learned so much about Saipov's communications was critical to defend him against the death penalty.

A full examination of Saipov's moral culpability will include knowing whether others share culpability for the events because they influenced Saipov's behavior, according to the defense submission.

Prosecutors revealed in November they had watched Saipov and two of his associates for years, recording his conversations with them to learn about his personal contacts, finances and potential exposure to Islamic State group propaganda, violent jihadism and Islamic extremism, the defense lawyers said.

They said prosecutors are failing to disclose more details in part on the grounds that Saipov was never an investigative target and wiretap evidence will not be introduced at trial.

The defense lawyers said the government's refusal to divulge exactly how it got its information about Saipov "unfairly insulates investigative techniques actually used in this case from legal challenge and judicial oversight."