LONG BEACH, N.Y. – Six Long Island cops claim they were targeted by their commissioner for supporting Republican Party candidates in local elections last year.

Long Beach Police Commissioner Michael Tangney, a longtime Democrat, demoted the cops, cut their overtime, switched them to midnight shifts and even filed false internal charges against them for “political payback,” the veteran officers claim in a $39 million lawsuit.

Tangney allegedly told one of the officers while demoting him, “It’s just the way politics work in this town.”

Officers James Canner, 44; Karl Hayes, 42; James McCormack, 55; John Radin, 53; Benjamin Tayne, 47; and Jose Miguez, 39, claim they turned to their union for help but that then-president Stefan Chernaski, another Democrat, ignored them.