Paul Hansmeier, a Minneapolis lawyer who pioneered a lucrative scheme suing thousands of people for copyright violations after they downloaded pornography that he and a partner had planted on an internet file-sharing server, pleaded guilty Friday to federal fraud and money laundering conspiracy charges.

Hansmeier, who is suspended from practicing law, had been scheduled for trial Sept. 5 in Minneapolis. His plea agreement allows him to withdraw the plea if he is successful in appealing the district court’s denial of his motion to dismiss the case.

“I think we came to a fair resolution and will see what happens at sentencing and the Eighth Circuit,” said Manny Atwal, the federal defender representing Hansmeier.

According to the plea agreement, Hansmeier admitted that he and John Steele formed a law firm known as Steele Hansmeier in September 2010 and began representing individuals and entities that owned copyrights to pornographic movies. They monitored websites and obtained the internet addresses of individuals who downloaded or tried to download the movies, then filed copyright infringement lawsuits against those “John Doe” individuals to find out their identities so they could sue them personally.

They offered to settle in exchange for a fee of about $3,000, and they collected a total of at least $3 million.

In 2011, Hansmeier’s brother Peter — identified in the plea agreement by his initials, P.H. — uploaded the movies to BitTorrent file-sharing websites, including Pirate Bay, to “entice people to download the movies and make it easier to catch those who attempted to obtain the movies,” the agreement says.

Hansmeier and Steele masked their direct involvement in the scheme by operating through an Illinois law firm called Prenda Law. They also created various entities to use as plaintiffs in their copyright lawsuits. Hansmeier and Steele eventually went into the porn production business themselves to get more material.

Hansmeier and Steele concealed from the courts that they were behind the scheme. In 2012, they created a company called Under the Bridge Consulting that they used to fraudulently transfer $1 million from the scheme to Hansmeier and Steele.

Steele pleaded guilty in March 2017 and agreed to cooperate in the case.

Hansmeier’s agreement calls for enhanced penalties because of the loss, the number of victims, the sophisticated scheme, his leadership of it, his abuse of trust and what the government calls his willful obstruction of justice. The agreement notes that full restitution to the victims is mandatory and that it won’t be limited to the counts of conviction.

In exchange for the plea, prosecutors agreed not to charge him with bankruptcy fraud or to seek a sentence exceeding 150 months in prison. The ultimate sentence is up to U.S. District Judge Joan Ericksen.