(CNN) Michael Cohen, President Donald Trump's former personal attorney, pleaded guilty in Manhattan federal court Tuesday to eight criminal counts and implicated Trump himself in a remarkable courtroom moment.

Cohen admitted that "in coordination and at the direction of a candidate for federal office," he kept information that would have harmed Trump from becoming public during the 2016 election cycle.

The charges against Cohen, an attorney for Trump until earlier this year and a member of his inner circle throughout his presidential campaign, bring a climactic end to a months-long investigation by the US Attorney's Office for the Southern District of New York. And they expose, through the criminal information filed against Cohen in court, that he acted with Trump and his allies, including David Pecker, the CEO of the National Enquirer's publisher, American Media Inc., to suppress potentially damaging claims against the now-President.

The dramatic conclusion to the investigation into Cohen launches a fresh round of questions about Trump's actions. Though Trump himself isn't named, the court filing refers to an Individual-1, who by January 2017 had become president of the United States.

The counts against Cohen included tax fraud, false statements to a bank and campaign finance violations tied to his work for Trump, including payments Cohen made or helped orchestrate that were designed to silence women who claimed affairs with the then-candidate.

Though not named in the plea deal filed in court, the women whom Cohen helped silence were two who have since gone public with their claims of sexual encounters or affairs with Trump: a porn star named Stephanie Clifford, who goes by the stage name Stormy Daniels, and a former Playboy model named Karen McDougal. Trump has denied the claims.

In the case of Clifford, Cohen arranged a nondisclosure agreement for which he paid her $130,000, and for that Cohen was charged with making an excessive campaign contribution, since the payment was made in service of the campaign and exceeded the federal limit.

For McDougal, Cohen and the CEO of a media company "worked together to keep an individual from publicly disclosing" information that would have been harmful to a candidate, saying the individual received $150,000. In the summer of 2016, American Media Inc. paid McDougal $150,000 for a contract that effectively silenced her claims of an affair with Trump.

"In or about August 2015, the Chairman and Chief Executive of Corporation-1 ("Chairman-1"), in coordination with MICHAEL COHEN, the defendant, and one or more members of the campaign, offered to help deal with negative stories about Individual-l's relationships with women by, among other things, assisting the campaign in identifying such stories so they could be purchased and their publication avoided," the criminal information says. "Chairman-1 agreed to keep COHEN apprised of any such negative stories."

Though the corporation and its chairman are not named, court filings describe the corporation as "a media company that owns, among other things, a popular tabloid magazine."

A spokesman for AMI didn't immediately respond to a request for comment.

The court filings also link AMI to Clifford, saying that in October 2016, an agent for an adult film actress contacted the company and said she was willing to go public with her allegations of an affair with Trump. Pecker then contacted Cohen, and Cohen negotiated with the woman's attorney to "purchase [her] silence" for $130,000.

After Cohen failed to either execute the agreement immediately or pay the woman, she threatened, in late October -- 14 days before the election -- to Pecker to take her story to another publication. Pecker then informed Cohen, in part by calling him on an encrypted phone app. He told Cohen that the deal needed to be completed "or it could look awfully bad for everyone," according to court filings. Cohen then agreed to make the payment and finalize the deal.

Appearing in court on Tuesday, Cohen said of the charge linked to McDougal that it was done "for the principal purpose of influencing the election." Regarding the charge linked to Clifford, Cohen said the money "was later repaid to me by the candidate."

Assistant US Attorney Andrea Griswold said prosecutors would have been prepared to present evidence during a trial that these were so-called hush payments.

"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," she said.

Cohen faces up to 65 years in prison.

Judge William H. Pauley set a sentencing date for Cohen for December 12. The judge set a $500,000 bond, which must be co-signed by Cohen's wife and another party.

When checking if he was of sound mind, Pauley asked Cohen whether he had consumed alcohol. Cohen replied that he had some alcohol with dinner the previous evening -- a glass of Glenlivet 12, on the rocks.

The charges against Cohen also covered a range of his activity outside of his work for Trump. In the tax evasion scheme linked to his taxi medallion business, Cohen failed to report more than $4 million in income, according to the criminal information filed against him, resulting in his avoidance of more than $1.4 million in taxes he would have had to owe the Internal Revenue Service.

Cohen also pleaded guilty to making false statements to a bank by understating his medallion debt in order to secure loans to buy property. He had omitted a $14 million line of credit on applications so that he could purchase properties, including a Park Avenue condominium and a summer home. He also got a $500,000 home equity line of credit in April 2016, a loan he never would have gotten if the bank knew of the $14 million debt, the court filings say.

Shortly after 4 p.m. on Tuesday, after having surrendered to the FBI, Cohen entered court in a dark suit, white shirt and gold tie, followed moments later by his attorney, Guy Petrillo.

Also in attendance to observe Cohen's guilty plea in court were Deputy US Attorney Robert Khuzami and the public corruption chief for the Southern District of New York.

"These are very serious charges that reflect a pattern of lies and dishonesty," Khuzami said outside the courthouse following the proceedings. "They are significant in their own right. They are particularly significant when done by a lawyer."

By pleading guilty, both Cohen and prosecutors avoid the spectacle and uncertainty of a trial. But the plea deal is a significant blow for Trump, as Cohen was part of Trump's inner circle for more than a decade, working as his personal attorney at the Trump Organization and continuing to advise the President after the election. Cohen once said he would take a bullet for Trump, but the relationship between the two men has frayed since an FBI raid in April of Cohen's office, hotel room and home.

In turn, Trump has distanced himself from Cohen, who has told friends he has felt isolated, according to the friends . Last month, Cohen told ABC News his loyalty is to his family and country first, not the President.

The Cohen investigation was referred to the Southern District of New York by special counsel Robert Mueller. The plea deal does not include cooperation by Cohen, and it is unclear if he will follow through on his previous assertion to friends , according to sources, that he is willing to talk to Mueller.

It's not clear how the plea deal with Cohen might affect other entities that have been under scrutiny by federal prosecutors as part of the Cohen investigation, including AMI or Pecker.

Correction: This story has been updated to correct the name of the alcohol that Cohen said he drank on Monday night.