Michael Cohen, Donald Trump’s longtime personal attorney, told a federal court in Manhattan on Tuesday that he broke the law at Trump’s behest during the 2016 campaign, paying off two women with whom the president had extramarital affairs so that they wouldn’t damage his electoral prospects. And it only got worse for Trump from there.

Cohen’s admission, which came as part of a plea agreement struck with federal prosecutors, places the president within arm’s reach of criminal activity during the election. Cohen pleaded guilty to eight charges, including five counts of tax evasion, one count of making a false statement to a bank, and two counts related to violating campaign-finance laws. He was released on $500,000 bail and will be sentenced at a later date.

In a coincidence that would have been too blunt for Hollywood screenwriters, Cohen’s guilty plea came within minutes of a Virginia jury’s verdict in the trial of Paul Manafort. The jurors found the former Trump campaign chairman guilty on eight of the eighteen charges against him: five counts of tax fraud, two counts of bank fraud, and one count of failing to register a foreign account. While the jury failed to reach a verdict on the other ten charges, Manafort’s conviction marks a significant victory for Robert Mueller, the special counsel in the Russia investigation.

Tuesday’s news cycle only underscored the legal peril faced by members of Trump’s inner circle. Rick Gates, his former deputy campaign chairman, testified against Manafort at that trial as part of a plea deal he struck with Mueller’s office this spring. George Papadopoulos, Trump’s former foreign-policy aide, is facing six months in prison after the special counsel told a federal judge last week that he hindered the Russia investigation. And Michael Flynn, Trump’s former national security advisor, filed a joint report with Mueller’s office on Tuesday afternoon to delay sentencing for lying to the FBI because his cooperation was still ongoing.

The whirlwind of legal proceedings is now closer to the president than ever before. The risk now is that he delivers a proportionate counterattack. For more than a year, Trump has sought to undermine the investigations into himself and his allies at every turn. He has repeatedly condemned the inquiries as a partisan “witch hunt.” He has accused prosecutors of trying to overturn the 2016 election. He has conducted a slow-rolling purge of the FBI’s upper ranks, and threatened to fire both Mueller and Deputy Attorney General Rod Rosenstein.

As Trump arrived in West Virginia late on Tuesday afternoon, he again described the investigation as a “witch hunt,” saying of the Manafort verdict, “This has nothing to do with Russian collusion.” He had no comment on the Cohen case.

Lanny Davis, Cohen’s attorney, said of his client in a statement on Twitter, “Today he stood up and testified under oath that Donald Trump directed him to commit a crime by making payments to two women for the principal purpose of influencing an election. If those payments were a crime for Michael Cohen, then why wouldn’t they be a crime for Donald Trump?”

Cohen’s legal woes began in April when federal investigators raided his office, home, and hotel room and seized a vast amount of evidence, including thousands of pages of business and tax records. The raid was an extraordinary move by any standard. Justice Department rules impose significant hurdles on federal prosecutors who seek to search lawyers’ offices, no matter the reason. A search warrant application targeting the president’s personal attorney apparently drew even greater scrutiny from the department: The New York Times later reported that Rosenstein personally approved the search.

Trump responded to news of the raid with fury. “It’s an attack on our country, in a true sense,” he told reporters during a meeting with his national-security advisers. “It’s an attack on what we all stand for.” At the time, Cohen’s lawyer told reporters that the investigation had spun out of a referral from Mueller’s office. The referral suggested that Mueller’s team discovered potential evidence of criminal behavior that went beyond the special counsel’s jurisdiction.

The charges against Cohen cover two aspects of his professional life. In addition to his work for the Trump Organization, Cohen also managed an eclectic, shadowy portfolio of investments and side businesses. Federal prosecutors zeroed in on his investments in taxi medallions in New York City. In court filings on Tuesday, prosecutors said that Cohen underreported more than $4 million of income derived from leasing the medallions to taxi operators.

At the same time, Cohen used his medallions as collateral to obtain a $20 million line of credit from a bank. He then sought loans from two other banks, one in 2013 and the other in 2015, by misleading them about the scope of his medallion-related debts. In one instance, he told a bank that he had closed out the original line of credit when he had actually overdrawn it.

“Michael Cohen is a lawyer who, rather than setting an example of respect for the law, instead chose to break the law, repeatedly over many years and in a variety of ways,” Robert Khuzami, the acting U.S. attorney in Manhattan, said on Tuesday. “His day of reckoning serves as a reminder that we are a nation of laws, with one set of rules that applies equally to everyone.”

The other aspect of Cohen’s case hits closer to home for the president. In addition to his work as the Trump Organization’s general counsel, Cohen worked for more than a decade as the president’s legal fixer. In that capacity, he negotiated multiple hush-money agreements with women who had sexual relationships with Trump.

The first one was struck through American Media Inc., which publishes the National Enquirer tabloid, and its chairman David Pecker. The company, with Cohen’s help and payment, offered Karen McDougal $150,000 in the summer of 2016 to not go public about her affair a decade earlier with Trump, who was then the Republican presidential nominee. The arrangement counted as an in-kind campaign contribution because it was made to further Trump’s chance of being elected president.

Cohen then struck a similar arrangement with Stephanie Clifford, the adult film actress known as Stormy Daniels. Cohen said that at Trump’s direction, he paid Clifford $130,000 in October 2016 in exchange for her signature on a non-disclosure agreement that covered her sexual relationship with Trump in 2006. Federal prosecutors told the court that Cohen “made the payments described herein in order to influence the 2016 presidential election.” The payments worked—neither woman went public about their sexual relationships with Trump until after the election—but they also exceeded federal campaign contribution limits.

The plea deal did not include a provision requiring Cohen to cooperate with investigators in other cases. That may come as something of a relief to the Trump White House. As the full scale of Cohen’s legal situation became apparent earlier this year, the president and his aides reportedly thought that it could pose a greater political and legal threat to the president than Mueller’s inquiry into Russian election interference.

Whether Cohen’s lack of cooperation with prosecutors will provide any comfort to the president himself remains to be seen. By pleading guilty to the campaign-finance violation, Cohen effectively admits that he participated in an illegal effort to evade federal election laws in the hopes of bolstering Trump’s campaign. It’s unclear whether Trump himself faces greater legal exposure as a result—either now or years from now. There’s an unsettled debate over whether the Justice Department can indict a sitting president, as unlikely as it would be, but there would be no constitutional obstacle to charging Trump after he leaves office.