SAN JOSE — The city and its police union were close to a deal on raises Wednesday that would wrap up a pay and benefits package officers say is crucial to keeping cops on the depleted force.

But a last-minute dispute over how to implement a proposed pension settlement reached last month threatens to hold up the accord.

“All of a sudden, the city attorney comes up with some idea to not implement it and to change the agreement,” said Tom Saggau, spokesman for the San Jose Police Officers’ Association. “And we’re going to have none of it.”

City leaders on Tuesday offered police officers a one-year labor agreement that includes 8 percent in ongoing raises and 5 percent one-time bonuses, ending four months of contentious labor negotiations. The agreement gives San Jose officers a 4 percent salary increase in January and another 4 percent raise in July, in addition to a 5 percent bonus: 2.5 percent when the POA ratifies the deal, and another 2.5 percent in December.

It also offers the 5 percent as a “signing bonus” to former officers who return to the force in the next year.

But while union leaders said the wage proposal is a “worthy” one, it’s being overshadowed by last-minute snags with implementing the settlement agreement on the Measure B pension reforms city voters approved three years ago. The proposed settlement with the fire and police unions aimed to replace the pension reform measure with a number of compromises.

The Measure B settlement has yet to be ratified by the police union, leading to the City Council yanking it from a meeting agenda Tuesday. And POA officials say the wage deal and Measure B settlement go hand-in-hand — police officers won’t ratify one deal without the other.

The city and union can’t agree on how to replace Measure B with the new settlement. The agreement outlines a “quo warranto” process, which means a Superior Court judge will invalidate Measure B and allow the city to replace it with the settlement. But Mayor Sam Liccardo has concerns about that process, saying he’s worried San Jose will get sued by some of the nearly 70 percent of residents who voted for Measure B.

City Attorney Rick Doyle has proposed a “stay” on Measure B, union officials said, and wants to pass ordinances to replace it while putting the changes out to voters in 2016.

“This is not a bait-and-switch,” Doyle said Wednesday. “All it takes it one person to sue the city. In our view, this significantly reduces the risk.”

But since Measure B made changes to the city charter, it’s unclear if ordinances could modify that. A quo warranto proceeding was used in Seal Beach and other cities to overturn voter-approved initiatives.

“The advantage of quo warranto is it would invalidate the entire ballot proposition and allow everybody to start over,” said Stephen Silver, a Santa Monica-based attorney who worked on the Seal Beach case and represents San Jose retirees in a lawsuit.

The city’s proposal on police raises also includes 2.5 percent of pay for bilingual officers, mandatory overtime processes and annual education reimbursement of $1,000. The officers’ union will begin voting on the wage agreement Friday if the parties resolve the dispute over Measure B.

The City Council called a special closed-session Friday to discuss it.

Follow Ramona Giwargis at Twitter.com/ramonagiwargis or contact her at 408-920-5705.