Michael Cohen, former personal lawyer to U.S. President Donald Trump, exits from federal court in New York, U.S., on Tuesday, Aug. 21, 2018.

Michael Cohen, the former personal lawyer and fixer for President Donald Trump, pleaded guilty on Tuesday to eight counts related to tax fraud, excessive campaign contributions, making false statements to a financial institution, and unlawful corporate contributions at a court hearing in New York on Tuesday. He could face more than five years in prison.

Two of the counts that Cohen pleaded guilty to appear to relate to Trump directly. Cohen admitted on Tuesday to making payments to two women at the direction of an unidentified candidate for political office who appears to be the president. Those payments, Cohen said, were made to influence the outcome of the election.

While Cohen didn't name Trump directly during the hearing, his attorney Lanny Davis said shortly afterward that "Donald Trump directed [Cohen] to commit a crime by making payments to two women for the principal purpose of influencing an election." The Justice Department confirmed late Tuesday that Trump was the unidentified candidate.

Cohen pleaded guilty to one count of causing an illegal corporate contribution in 2016 by working with the CEO of a media company, at the direction of a federal candidate for federal election, to keep information from the public. Cohen said he paid a woman $150,000 "for the principal purpose of influencing the election."

Last month, a recording was released of Cohen and Trump discussing a $150,000 payment from a tabloid publisher to a former Playboy model for the rights to her story about an alleged affair with the president. The recording was made two months before the 2016 presidential election.