President Trump’s former personal fixer Michael Cohen admitted in court Tuesday that he and Trump paid two women hush money “for the purpose of influencing the election.”

The stunning development — which contradicts statements made by the president and White House denying any knowledge of the payments — came as Cohen copped to two campaign-finance violations related to the illegal payments, five unrelated counts of tax evasion and one count of making a false statement to a bank related to his family’s taxi company.

Cohen’s lawyer, Lanny Davis, later said there is still someone out there who should be prosecuted — pointing squarely toward the Oval Office.

“Today, [Cohen] 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,” Davis said.

“If those payments were a crime for Michael Cohen, then why wouldn’t they be a crime for Donald Trump?”

Cohen, in a statement he read in court, detailed each of his crimes, adding of the hush money, “I participated in this conduct, which on my part took place in Manhattan, for the principal purpose of influencing the [2016 presidential] election.

“On or about the summer of 2016, in coordination with, and at the direction of, a candidate for federal office, I and the CEO of a media company at the request of the candidate worked together to keep an individual with information that would be harmful to the candidate and to the campaign from publicly disclosing this information … under which she received compensation of $150,000,” he said.

Based on the dates and dollars, it appears Cohen was referring in his payments made to former Playboy model Karen McDougal to keep quiet about her alleged 2006-2007 affair with Trump.

He gave the tabloid The National Enquirer the money to buy the rights McDougal’s story — to make sure the kiss-and-tell never saw the light of day.

Cohen — who once said he’d “take a bullet” for the president — also copped to cutting an personal check to a woman who says she had an affair with Trump.

“With and at the direction of the same candidate, I arranged to make a payment to a second individual to keep the individual from disclosing the information. I used a company under my control to make a payment of $130,000 later repaid to me by the candidate. I participated in this conduct for the purpose of influencing the election,” he said.

That woman is believed to be porn star Stormy Daniels, who says Trump had an affair with her in 2006.

The payment constituted a contribution to Trump’s campaign and far exceeded the legal limit of $2,700 per candidate per year, Cohen admitted in pleading guilty.

The disgraced lawyer exhaled a deep sigh before turning himself in to the feds Tuesday afternoon ahead of his court hearing, where he wore a black suit, a gold tie and a haggard expression.

When a judge asked him if he had any booze in the last 24 hours, he admitted having a Scotch on Monday night.

“Last night at dinner, I had a glass of Glenlivet 12 on the rocks,” he told Judge William Pauley III.

The judge replied, “All right. Is it your custom to do that, sir?”

Cohen replied, “No, your Honor.”

While the lawyer publicly vowed to defend Trump to his dying day, he changed his tune after the feds raided his office, residence and hotel room in April.

“Michael Cohen took this step today 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 said.

Trump claimed in April that he was not aware of the Daniels payments, and the White House vehemently denied he paid McDougal — until audio tapes were made public showing the president discussing the payments with Cohen.

But Trump lawyer Rudy Giuliani insisted Tuesday, “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.”

The plea agreement Cohen struck with prosecutors does not require he cooperate with Special Counsel Robert Mueller’s Russia probe.

Still, the revelations spell trouble for President Trump.

“To the extent Cohen’s claims that he acted at the direction of a candidate could be corroborated, this could be a big problem for Donald Trump,” said Rick Hasen, an election-law expert and professor of law and political science at University of California-Irvine. “Even if he’s not indicted, this is a criminal charge with real penalties.”

Trump ignored questions about Cohen’s revelations as he left Air Force One in West Virginia ahead of a planned rally there. White House spokeswoman Sarah Huckabee Sanders referred questions to Trump’s outside counsel.

As the president prepared to meet his supporters in West Virginia, Cohen left Manhattan federal court on $500,000 bond, only to be greeted with shouts of “lock him up”

The chant — a parody of the anti-Hillary Clinton refrain favored by Trump’s supporters during the 2016 election — represented an ironic twist for Cohen, who once tweeted “@HillaryClinton when you go to prison for defrauding America and perjury, your room and board will be free!”

He faces up to 65 years in prison when he’s sentenced Dec. 12.

Cohen, “decided he was above the law, and for that, he is going to pay a very, very serious price,” said Manhattan Deputy US attorney Robert Khuzami after court.

Meanwhile, it was revealed Tuesday that the investigation into 4 million pieces of evidence recovered during the April raid of his properties will cost more than $1 million.

The cost will be split between the government prosecutors and Cohen’s team.

Manhattan Federal Judge Kimba Wood determined that all but roughly 7,000 could be turned over to prosecutors as evidence.

Additional reporting by Nolan Hicks and Marisa Schultz with Post wires