A dispute over illegal immigration has turned ugly in Westchester, with a leader of the Board of Legislators accusing County Executive Rob Astorino of acting like a Nazi.

Majority Leader Catherine Borgia (D-Ossining) took issue with comments Astorino made while vetoing a bill that would have protect undocumented immigrants from deportation.

Astorino deried the bill as a “Sanctuary County” plan.

“It’s the classic `Big Lie’ technique. All clever Nazis use it,” Borgia said in an Aug. 16 email obtained by The Post.

In the email, Borgia was looking for votes to override Astorino’s veto.

The legislation would have blocked county police and other local officials from communicating with federal authorities solely on civil immigration matters.

It came on the heels of President Trump and US Attorney Jeff Session’s push to deport illegal immigrants.

Supporters insist the measure complies with federal law and argue that county law enforcement officials should not act as immigration officials.

But Astorino, a Republican, said such a law would hinder law enforcement and jeopardize the county’s federal funding.

Astorino said the bill “endangers public safety, violates federal law, infringes upon long-established principles of law enforcement cooperation and jeopardizes millions in federal public safety grants.”

While he said he’s working on an executive order to ease fears of undocumented immigrants that they will be deported if they report crimes or seek medical assistance, all bets are off for those who are arrested for crimes.

“If you end up in jail for committing a crime, and you’re not here legally, we’re not providing a sanctuary for you,” Astorino said.

Borgia defended her comments when contacted by The Post.

“Perhaps I should have been more clear: the `big lie’ was a classic propaganda technique used very successfully by the Nazis,” she said. “This is in no way a sanctuary county bill, as it fully complies with federal law. You can call something by the wrong name again and again and again but that does not make it more accurate. My dog is not a cat, even if I feed him catnip and call him `kitty’ every day for 10 years.”