A Mexican town’s entire police force has been arrested in connection with the slaying of a mayoral candidate.

The 28 officers from the town of Ocampo in the western state of Michoacan were arrested Sunday on suspicion of involvement in the murder of Fernando Angeles Juarez.

Juarez, 64, was running as the candidate for the center-left Party of the Democratic Revolution in Ocampo, before being shot dead June 21.

State officials took the cops in for having alleged ties with criminal groups possibly involved in the candidate’s killing, El Universal reported.

Public Security Director Venancio Colin was chased out by 16 Ocampo cops in a hail of bullets when he first tried to arrest them Saturday, sources told the paper.

He came back Sunday with reinforcements and arrested the entire force, who were cuffed and taken to the state capital for questioning.

Juarez, a successful businessman with little previous political experience, was the third politician to be killed in Michoacan in just over a week, the BBC reported.

“He couldn’t stand seeing so much poverty, inequality and corruption and so he decided to run,” one of his closest friends, Miguel Malagón, told El Universal.

Mexico will vote for a new president July 1, alongside more than 3,000 federal, state and municipal posts.

More than 1,000 candidates have dropped out of local races ahead of the elections because they fear being gunned down.

Drug cartels are suspected in many murders of politicians and the 2018 campaign has been a bloody one — with dozens of politicians, candidates and activists murdered by gangsters.

On June 12, congressional candidate Fernando Purón was shot in the head point-blank as he posed for a selfie after an election debate in Piedras Negras.

With Post wires