(CNN) Michael Cohen, President Donald Trump's former personal attorney, pleaded guilty in Manhattan federal court Tuesday to eight criminal counts, admitting that "in coordination and at the direction of a candidate for federal office" he acted to keep information that would have been harmful to the candidate and the campaign 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 an end to a months-long investigation by the US Attorney's Office for the Southern District of New York. 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. 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, the publisher of the National Enquirer, American Media Inc. paid McDougal $150,000 for a contract that effectively silenced her claims of an affair with Trump. 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." 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 Lillet on the rocks. The plea deal Shortly after 4 p.m., Cohen entered court in a dark suit, white shirt and gold tie, followed moments later by his attorney, Guy Petrillo. Cohen had surrendered to the FBI earlier Tuesday. The deal would include jail time and a substantial monetary fine. Jail time was one of the sticking points in the negotiations between the two sides, according to one source. Cohen had been pressing for three years but prosecutors sought 50 months. Cohen has been concerned about asset forfeiture, and the possibility that he would leave his family with nothing. Prosecutors made clear there was a bigger risk that he would have to forfeit assets should he go to trial and be found guilty. 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. As part of the plea deal under discussion earlier Tuesday, Cohen was not expected to cooperate with the government, one source told CNN. However, by pleading guilty both Cohen and prosecutors would avoid the spectacle and uncertainty of a trial. A plea deal could be a significant blow for Trump. 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. 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. On Tuesday morning, Cohen was seen entering his attorney's office and did not respond to questions. Cohen's attorneys, Petrillo and Lanny Davis, didn't immediately respond to requests for comment. A spokesman for the US attorney's office declined to comment. The investigation 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. Prosecutors said in court their investigation is into Cohen's personal financial dealings. The search warrant authorizing the FBI raid referenced Cohen's taxi medallion business, the identity of banks that loaned him money and payments made to suppress negative information during the presidential campaign. 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 the publisher of the National Enquirer, American Media Inc. This is an absolutely critical moment for Donald Trump's presidency CNN and the The New York Times reported Sunday that investigators were finalizing criminal charges against Cohen and could announce them by the end of the month. According to the Times, investigators were trying to determine whether Cohen misrepresented the value of his assets to obtain the loans from two financial institutions that have catered to the taxi industry. They were also scrutinizing whether he failed to properly report his income from taxi medallions to the Internal Revenue Service, the Times reported. CNN previously reported in April that Cohen is under investigation for possible bank and tax fraud, that his taxi medallions are a focus of the investigation, and that one of the banks that made the loans was Sterling National Bank, whose spokesman declined to comment earlier this month about federal scrutiny of the loans. The Times, citing financial records and people with knowledge of the matter, reported that the other financial institution is the Melrose Credit Union. Prosecutors have been scrutinizing a variety of documents submitted by Cohen to various institutions, including those to the Internal Revenue Service and those to Sterling National Bank, CNN has reported.