Michael Cohen, President Donald Trump's former fixer, admitted in court while pleading guilty to an eight-count information to paying hush money to two women to secure their silence in order to influence a federal election.

In addition to admitting that he made a $130,000 payment to Stephanie Clifford, known as Stormy Daniels, to silence her about her alleged affair with Trump, he also admitted to working with the CEO of a media company to pay $150,000 to silence an individual with information that would be “harmful to the candidate.”

“I participated in this conduct, which on my part took place in Manhattan for the principal purpose of influencing the election,” Cohen said when describing the conduct associated with the campaign contribution charges to U.S. District Judge William Pauley III of the Southern District of New York.

Cohen's plea deal was announced the same day that Paul Manafort, the former chairman of Trump's campaign, was found guilty of tax and bank fraud, along with failing to disclose foreign bank accounts.

Cohen reportedly worked with the CEO of the National Enquirer to pay $150,000 to ex-Playboy model Karen McDougal for her silence about an alleged 2006 affair with Trump, a charge the president denies.

“The proof on these counts at trial would establish that these payments were made in order to ensure that each recipient of the payments did not publicize their stories of alleged affairs with the candidate,” said Assistant U.S. Attorney Andrea Griswold, though Trump was not mentioned by name during the hearing nor during public statements by Robert Khuzami, the deputy U.S. attorney for the Southern District of New York following the hearing.

Khuzami oversaw the Cohen investigation and sat in the front row of a packed courtroom for the hearing. U.S. Attorney Geoffrey Berman, who was appointed to his office by U.S. Attorney General Jeff Sessions, recused himself from the case.

In addition to the two counts of making excessive campaign donations, Cohen also pleaded guilty to five counts of tax evasion for failing to report more than $4 million in income from 2012 to 2016; and one count of making false statements to a lending institution—specifically that he did not report $14 million in liabilities when applying for a home equity line of credit.

Cohen, 51, faces a maximum prison sentence of 30 years on the false statements charge and a five-year maximum prison sentence on the remaining charges.

Cohen appeared emotional at times during the roughly one-hour hearing, at times casting his eyes downward when answering Pauley's questions. He was released on a $500,000 recognizance bond.

As he left the Southern District courthouse in lower Manhattan, a few onlookers gathered on the sidewalk and shouted, “Lock him up” as he entered a black SUV.

Clifford is suing Trump to be released from a nondisclosure deal she signed just before the 2016 election in exchange for the money.

Michael Avenatti, her attorney, tweeted that Tuesday's developments will allow him to have a stay lifted in his client's civil case against Trump in Los Angeles federal court, paving the way for an “expedited deposition of Trump under oath about what he knew, when he knew it and what he did about it.” He added, “We will disclose it all to the public.”

The criminal probe into Cohen was launched in April when investigators seized millions of items from Cohen's home and office.

Prosecutors on April 9 executed search warrants on Cohen's residence, home, safety deposit box and electronic devices. Cohen claimed the materials seized included privileged documents and communications related to clients of Cohen as well as Cohen's privileged communications with his own attorneys.

In a statement to reporters outside the Southern District courthouse, Khuzami said the charges against Cohen are “particularly significant” given that Cohen is a lawyer and thus should know the importance of “honest and fair dealing.”

“These are very serious charges that reflect a pattern of lies and dishonesty over an extended amount of time,” Khuzami said.

Cohen's plea deal comes just after a special master finished reviewing millions of items seized from Cohen's home and offices. The special master, Barbara Jones, a former Manhattan federal judge and current Bracewell partner, said she found nearly 7,150 items to be privileged, while 285 were highly personal in nature. These items were excluded from the more than 3.2 million that were handed over to Southern District federal prosecutors during the months-long process.

According to court papers, the charges incurred by Jones and Bracewell totaled up to more than $296,700.

Cohen's legal team shifted during the investigation. His legal team was previously led by McDermott Will & Emery partner Stephen Ryan.

In recent months, Cohen retained Petrillo Klein & Boxer name attorney Guy Petrillo who, along with Petrillo Klein partner Amy Lester, appeared alongside Cohen at the hearing.

Cohen also hired Lanny Davis, a Washington-based attorney and public relations expert who worked as special counsel to President Bill Clinton in the late 1990s.

“Michael Cohen took this step today so that his family can move on to the next chapter,” Davis said in a written statement following the hearing. “This is Michael fulfilling his promise made on July 2 to put his family and country first and tell the truth about Donald Trump. 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?”