Michael Avenatti, the brash lawyer best known for representing the pornographic film actress Stormy Daniels in her lawsuits against President Trump, was convicted on Friday of trying to extort more than $20 million from the apparel giant Nike.

After three days of deliberations in the case, brought by the U.S. Attorney’s Office in Manhattan, a jury found him guilty on all three counts, including attempted extortion and honest services fraud. Mr. Avenatti, who is scheduled to be sentenced on June 17, could face more than 40 years in prison in the case. He is set to stand trial in a separate federal criminal case on May 19.

Mr. Avenatti was charged last spring with an array of federal crimes in both New York and California, where he lived. Though he spent much of last year free on bail, a judge revoked that deal in January — after prosecutors argued that he was continuing to engage in criminal activity — and Mr. Avenatti was in federal custody as he stood trial in New York this year.

In making their case, federal prosecutors in Manhattan specifically accused Mr. Avenatti of trying to extort money from Nike in exchange for evidence he said he had of misconduct by company employees in the recruitment of college basketball players. He demanded that Nike hire him to conduct an internal investigation into its criminal exposure, prosecutors said, contending that he had alternatively requested $22.5 million to buy his silence and resolve potential claims by a youth basketball coach whom he said he represented.