BRIDGEPORT — When he waged his successful mayoral comeback campaign in 2015, Joe Ganim was the cops’ best friend.

Two years later, the returned mayor’s first attempt to reach a contract settlement with Bridgeport’s Finest is a failure.

The police union on Friday, without a contract since July 2016, rejected a new four-year pact, 152 votes to 133 votes, despite efforts by leadership this week to sell the deal as better than one imposed through state arbitration.

“I knew it was going to be close,” Sgt. Chuck Paris, the union president, said at City Hall, where his members spent the day casting ballots which were tallied by 6 p.m.

The proposed contract included salary increases in years two, three and four and placed time limits on the length officers could be placed on leave pending investigations, and on the investigations themselves.

The labor deal also made some modest attempts to curtail overtime — mainly reducing eight to four the mandatory hours an off-duty officer called on a day off has to be paid — but avoided more stringent overtime proposals and generally left existing benefits untouched.

Paris attributed the contract’s failure to newer recruits’ frustration with the health plan.

“They’re paying 31 percent — over $200 a week,” Paris said. “They’re lowest paid in the department and forced to pay the highest cost for health care.” And, Paris noted, newer officers also do not enjoy post-retirement health care.

The police union had been pushing the Ganim administration to switch over to a state health care initiative that allegedly offered a better plan at a lower cost.

Now, Paris said, the contract dispute heads back to arbitration before a state panel. The Ganim administration and the union had entered into arbitration last year, but, on their own, worked out the deal that was voted down Friday.

A Power Point presentation circulated to cops this week by parent union the American Federation of State, County and Municipal Employees warned that, if the proposal was rejected, the arbitration panel could impose a contract without a union vote.

The irony of Friday’s results is that Ganim strongly courted and received the police union’s backing in 2015 when, having been convicted of corruption in 2003 after running the city for 12 years, he wanted his old job back.

Ganim successfully defeated then-Mayor Bill Finch in that year’s Democratic primary before winning the general election, and did so by presenting himself as the law-and-order candidate who would restore manpower to the police department, bolster morale and reduce crime.

The last cop contract was approved in March 2015 after having been rejected by union members the prior May. At the time, police had been working under an expired contract for about three years and there was a contentious relationship with Finch and his police chief, Joseph Gaudett.

After returning to office in December 2015, Ganim followed through on a campaign promise to hire new cops — three classes of new officers have been filled so far. And he replaced Gaudett with Perez, the union’s preferred choice, in March 2016.

Since then, however, the relationship between the police union and City Hall has soured because of clashes over cutting overtime and the contract talks. Last summer, Paris, who had frequently been at Ganim’s side on the campaign trail and when the mayor was back in office, said, “Obviously, we put a lot of time and effort into helping the mayor get elected. We expected to have an open door to him and were hoping the negotiations would go smoothly. That has not been the case.”

An ongoing contentious contract dispute between Ganim and law enforcement in Connecticut’s largest city is also not necessarily a good thing for the mayor’s gubernatorial aspirations. He is running this year for governor and will eventually be courting labor unions like AFSCME, who provide particularly Democrats necessary campaign volunteers and resources during primaries and general elections.

A spokeperson for Ganim could not immediately be reached for comment about Friday’s vote.