Stormy Daniels’ lawsuit against Michael Cohen and one of her former lawyers, Keith Davidson — which accused them of colluding with each other in a bid to protect President Trump — has been officially dismissed.

Agreements had been made between Daniels, Cohen and Davidson back in May to settle her claims against them, and a Los Angeles County judge finally signed off on the deals Monday. The settlements were said to have been a “walk-away” — with no money being exchanged.

Davidson confirmed the judge’s dismissal of the suit, given the deal, with The Post on Tuesday.

Daniels’ lawsuit had accused him of being a “puppet” for the president and secretly working behind her back with Cohen, Trump’s lawyer at the time. The two were trying to get her to falsely deny having sex with Trump, her suit said.

The accusations surfaced after the hush-money suit that Daniels filed against Trump in which she tried to get tossed out a $130,000 settlement agreement about an alleged affair they had in 2006. The president has denied sleeping with Daniels. Cohen insists that he arranged the payment to keep Daniels quiet.

The porn star’s lawsuit against Trump was thrown out in March. Her suit against Cohen and Davidson had been filed by Daniels’ then-lawyer, Michael Avenatti, who is now facing federal charges for allegedly stealing millions of dollars from clients, in addition to tax and bank fraud.

Davidson told reporters in May that the pending agreement to dismiss Daniels’ case against him came not long after Avenatti departed.

“I think it was unfortunate that it was ever filed,” he said at the time, calling the suit “a sham from Day One.

“I think the only purpose this lawsuit served was to get Mr. Avenatti’s face on TV.”

With Post Wires