Louise Neathway, 39, pleaded guilty to one count each of grand larceny and criminal impersonation and four counts of perjury in exchange for five years’ probation. The unusual deal, called an Alford plea, allows her to maintain her innocence.

She’d been accused of threatening to go public with their affair.

“She feels very strongly that she’s been wrongly accused,” said her defense lawyer, Kevin Marino, as she stood beside him in a forest-green dress and black pumps.

Justice Bruce Allen, who served his last day on the bench Wednesday, made the generous parting gift to the British-born blonde over the objection of prosecutor Kenn Kern.

Allen asked her if she understood that as part of the deal she’d have to waive her right to appeal and drop all civil litigation. “That’s correct,” she answered. “I want to move on with my life.”

The Manhattan Supreme Court judge then praised Neathway for her courtroom decorum and recommended that she not be deported to the UK for the felony convictions. “I’ve had a chance to watch you for many, many days,” he said. “You conducted yourself in an exemplary manner. I think it would be a shame if anyone took action against you.”

The same judge presided over that case and sentenced her to five years’ probation. The two sentences will run concurrently.

Wednesday’s deal capped a nearly four-year saga for Neathway, who was arrested in 2012 for harassing Cashman, extorting $6,000 from him and trying to wrangle another $15,000 for an unspecified medical procedure.

Their 10-month affair turned nasty when Neathway found out he was also seeing another woman not his wife, she claimed.

Cashman’s wife filed for divorce a day after the scandal was made public. A spokesman for Cashman didn’t immediately return a request for comment.