MINNEAPOLIS — Federal agents ran a sweeping undercover surveillance operation earlier this year against progressive organizations, labor unions and other groups that had protested the immigration crackdown in Minneapolis, according to court documents filed Thursday and reported Friday by The Associated Press.

The program, called Operation Puppet Master, targeted what officials described as a network of conspirators aiding "violent opportunists and agitators." The documents were filed in the case of 15 people charged by federal prosecutors in June with impeding the crackdown, accusing them of conspiring against the federal government through actions that ranged from throwing ice chunks to setting up blockades.

The New York Times, which also reviewed the material, reported that the Department of Homeland Security opened the inquiry at its St. Paul office four days after Alex Pretti, a 37-year-old government nurse, was fatally shot by Border Patrol agents in late January while filming immigration enforcement. The investigation focused not on the agents but on labor unions, a climate group and socialist collectives that investigators believed had provided help and money to street protesters.

Among the organizations named were the Communications Workers of America, the Service Employees International Union, the AFL-CIO and the Sunrise Movement, according to the Times. Officials used invasive tactics through the first half of the year, infiltrating group chats, monitoring meetings at libraries and churches, and secretly obtaining financial records of organizations never accused of crimes.

One request underscored the secrecy. A DHS summons to FedWire, the money transfer system operated by the Federal Reserve, asked the recipient not to disclose that the summons existed for an indefinite period, according to documents cited by CNN.

The operation arose from a White House directive known as National Security Presidential Memorandum 7, Democracy Now reported.

DHS deployed roughly 3,000 federal officers to the Minneapolis-St. Paul area for about three months beginning late last year in what the department called its largest immigration enforcement operation ever. It produced thousands of arrests, mass protests and the fatal shootings of two U.S. citizens.

Minnesota U.S. Attorney Daniel N. Rosen has said the 15 defendants belonged to two groups he characterized as antifa, an umbrella term for a loosely organized militant left-wing movement. A defense attorney for one of the defendants, Isaac Sant, said at the time that his client had no such affiliation and called the label an invention of the far right.

Ahilan Arulanantham, a professor at the UCLA School of Law, told CNN the practices were disturbing and could over time deter people from expressing their beliefs. Groups named in the documents reacted angrily to the disclosures.