President Donald Trump’s former longtime personal attorney, Michael Cohen, appeared in a federal courtroom in Manhattan Tuesday to plead guilty to eight total charges, including five counts of tax evasion, two counts of campaign finance violations, and making false financial statements.

Speaking under oath, Cohen also said he worked “at the direction of the candidate” to keep a former Playboy model and a pornographic film actress quiet about alleged affairs they had with Trump, and that those actions were specifically designed to influence the 2016 presidential election. Although that candidate was not named, it was a clear reference to then-candidate Trump, for whom Cohen had worked for over a decade.

“Did you know what you were doing was wrong and illegal?” the judge, William H. Pauley III asked about these actions.

“Yes, your honor,” Cohen responded.

Wearing a dark suit and a gold tie and flaked by two of his attorneys, Cohen entered the court room through a side door at 4:03 p.m. and proceedings commenced less than 15 minutes later. He told the presiding judge that he had a glass of 12-year-old Glenlivet Scotch on the rocks the previous night but was now sober and aware of what he was doing.

Cohen appeared stoic throughout the nearly hour-long hearing, speaking only in response to the judge’s questions about his understanding of the plea agreement and reading the charges against him. At one point, Cohen shook his had when one of the prosecutors read the charges against him and described evidence they gathered to support their claims.

Cohen, who relished his role as Trump’s hard-charging “fixer” on sticky personal and professional problem, is the latest of Trump’s top associates to run into serious legal trouble.

At the same time that Cohen was appearing in court, a jury in Virginia announced that it had found Trump’s former campaign chairman, Paul Manafort, guilty on eight of 18 counts of bank and tax fraud in a case brought directly by Special Counsel Robert Mueller.

As part of that case, Trump’s former deputy campaign chairman, Rick Gates, pleaded guilty to financial fraud and lying to investigators. Trump’s former national security advisor, Michael Flynn, and foreign policy adviser George Papadopoulos are both awaiting sentencing after pleading guilty of lying to investigators.

The Cohen investigation was referred to prosecutors in New York’s Southern District by Mueller, who has been investigating Russian meddling in the 2016 election and any contacts the country had with the Trump campaign.

Unlike those cases, however, a Cohen plea on campaign finance charges would be the first time that a Trump associate was found guilty of a crime directly related to their work for the Trump campaign.

Federal prosecutors raided Cohen’s home, offices and hotel room in April. The prosecutors said that evidence for campaign finance violation stem from those raids. Investigators were reportedly looking for information regarding the $130,000 payment he made to porn star Stormy Daniels just weeks before the presidential election as well as a $150,000 payment to former Playboy model Karen McDougal. Both women allege they had affairs with President Trump years before he took office.

Trump has denied having an affair with McDougal through a White House spokesperson and claimed on Twitter that he only paid Daniels to stop “false and extortionist accusations made by her about an affair.”

Since the raid, Cohen has switched attorneys, obtaining the counsel of Guy Petrillo. In June, he stepped down from a role as deputy finance chairman of the Republican National Committee.

Cohen’s bail was set at $500,000. Collectively, his charges could amount to a maximum imprisonment over 65 years. His sentencing is set for Dec. 11, and cannot be determined until the probationary report is issued. Until his sentencing, Cohen is only allowed to travel to parts of New York, Illlinois, Florida and Washington, D.C.

Cohen has long been Trump’s fixer, but now he’s become a problem William Farrington—Polaris

Read More: Donald Trump Relied on Michael Cohen to Weather the Storm. Now The President Is On His Own

In late July, CNN obtained a recording that Cohen made of Trump discussing with him buying the rights to McDougal’s story about having an alleged affair with Trump years earlier, one way in which these kinds of scandals are kept quiet.

Cohen was proud of his role as Trump’s fixer, once comparing himself to TV character Ray Donovan and telling Vanity Fair in 2017 that he “would take a bullet for the president.” In an interview with ABC News in July, he changed his tone, however.

“My wife, my daughter and my son have my first loyalty and always will, he said. “I put family and country first.”

Lately Cohen and Trump’s relationship appears to have deteriorated, with Trump criticizing the recording on Twitter and his new attorney, Rudy Giuliani, saying that Cohen is not a credible witness and has “lied all his life.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Alana Abramson at Alana.Abramson@time.com.