Michael Cohen, President Trump’s longtime personal attorney, admitted Tuesday to violating federal campaign finance laws by arranging hush money payments to adult film star Stormy Daniels and former Playboy model Karen McDougal “at the direction” of then-candidate Trump.

In entering the plea, Cohen did not specifically name the two women or even Trump, recounting instead that he worked with an “unnamed candidate.” But the amounts and the dates all lined up with the payments made to Daniels and McDougal.

In total, Cohen pleaded guilty to five counts of tax evasion, one count of making false statements to a financial institution, one count of willfully causing an unlawful corporate contribution, and one count of making an excessive campaign contribution.

Cohen could have received up to 65 years in prison if convicted of all charges. However, as part of his plea deal, Cohen agreed not to challenge any sentence between 46 and 63 months. The deal does not involve a cooperation agreement with federal prosecutors.

Cohen is set to be sentenced Dec. 12.

In a statement, Trump attorney Rudy Giuliani said: “There is no allegation of any wrongdoing against the President in the government’s charges against Mr. Cohen. It is clear that, as the prosecutor noted, Mr. Cohen’s actions reflect a pattern of lies and dishonesty over a significant period of time.”

Cohen attorney Lanny Davis said his client had pleaded guilty “so that his family can move on to the next chapter.

"This is Michael fulfilling his promise made on July 2nd to put his family and country first and tell the truth about Donald Trump," Davis added. "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?"

Separately, Davis told Fox News that Cohen’s involvement in the Trump-Russia investigation does not end with the plea deal, but in fact "it is only the beginning."

Davis added that Cohen will speak with whoever is investigating the president to make sure the truth about Trump gets out.

Cohen’s home, office and hotel room were raided in April by federal investigators looking into his financial dealings, including his alleged practice of paying women to stay silent about claims they had affairs with now-President Trump. Daniels and McDougal have both claimed they had sex with Trump while he was married, which the president denies.

Cohen was behind the $130,000 payment to Daniels, and recently released a tape of a conversation from September 2016 of him and Trump discussing the possible payment to McDougal.

Trump denied to reporters in April that he knew anything about Cohen’s payments to Daniels, though the explanation from the president and Giuliani have shifted multiples times since.

In May, Giuliani initially told Fox News’ Sean Hannity that Trump had reimbursed Cohen for the payment to Daniels. Giuliani later claimed that the president was unaware the money would be going to Daniels and said Trump repaid Cohen for unspecified “expenses.”

Deputy U.S. Attorney Robert Khuzami told reporters that in January 2017, Cohen had begun seeking reimbursement for the payments to both women by “submitting invoices to the candidate’s company” — believed to be the Trump Organization — that falsely indicated that Cohen had provided legal services in the year 2017.

“In fact ... [Cohen] provided no legal services for the year 2017, and it was simply a means to obtain reimbursement for the unlawful campaign contribution,” Khuzami said.

According to prosecutors, Cohen sent reimbursement invoices to “one or more” members of the Trump Organization requesting $35,000 per month.

The Wall Street Journal reported in November 2016 that McDougal was paid $150,000 by American Media Inc. -- the parent company to the National Enquirer — for the rights to the story, but it never ran.

According to court documents, Cohen reached an agreement with “Chairman-1” — believed to be American Media Chairman and CEO David Pecker — to pay $125,000 for “the rights to the non-disclosure portion” of McDougal’s agreement with American Media. Prosecutors say Cohen created a shell entity, “Resolution Consultants LLC” to execute the transaction.

An agreement was signed, but according to prosecutors, “Chairman-1” contacted Cohen in early October 2016 before any money could be exchanged and told him "that the deal was off and that Cohen should tear up the assignment agreement." The documents say that Cohen did not do so and the agreement was found during the April search of his office.

Cohen also admitted Tuesday to underreporting his income by $4.1 million on his tax returns for the years between 2012 and 2016. Of that amount, $2.5 million was interest payments from a personal loan; $1.3 million was income from his taxi medallion business; $100,000 was income from brokerage commissions; and $200,000 was from “consulting fees.”

The investigation into Cohen was handled by prosecutors in the Southern District of New York after it was referred to them by Special Counsel Robert Mueller’s office.

Trump has repeatedly blasted developments in the Cohen investigation. In April, after Cohen’s offices were raided, he declared “attorney-client privilege is dead.” Last month, he slammed both the FBI raid and Cohen’s taping of discussions about paying McDougal as “inconceivable.”

“Inconceivable that the government would break into a lawyer’s office (early in the morning) - almost unheard of,” he tweeted. “Even more inconceivable that a lawyer would tape a client - totally unheard of & perhaps illegal.”

But, possibly in reference to questions about whether he had violated any campaign finance laws, Trump added that “your favorite President did nothing wrong!”

Before the election, Cohen had been a trusted member of the Trump organization, working out of an office in Trump Tower next to one used by his boss.

He raised millions for Trump’s campaign and, after being interviewed by the House Intelligence Committee last year, told Vanity Fair that Trump had no part in the suspected Russian conspiracy to tamper with the election.

However, Cohen appeared to distance himself from Trump last month. In an interview with ABC News, which was referenced by Davis Tuesday, Cohen said that “my wife, my daughter and my son have my first loyalty and always will. I put family and country first.”

Fox News’ Tamara Gitt, Lissa Kaplan and The Associated Press contributed to this report.