The agreement would allow the city to change fire employees' yearly "step" raises, start bargaining with firefighters over pensions, and move or fire medics who lose their medical certification. Union members would keep their workweek limits and special overtime.

If the contract is approved in two weeks by a vote of the union's membership, it could lead to three years of labor peace for Clearwater and its firefighters, who have been at odds for years.

But the two sides could just as easily head back to mediation if the contract is rejected by the union's membership, which has voiced growing agitation over the city's attempts at cost cutting.

Over the last decade, union members have overwhelmingly rejected five of six tentative agreements, most recently rejecting a mediator's recommendations in 2009. The last time the union members ratified a contract was in 2005.

City and union leaders hope this contract will be different.

"It has been a long three years," union president Gerard DeVivo said. "I believe it's a fair deal for both sides."

Union and city attorneys made the agreement Monday during a hearing by a special magistrate who was appointed as a mediator after an impasse was declared in March. In an internal e-mail, city human resources director Joe Roseto called the union's interest in an agreement "a somewhat startling turn of events."

The contract, which would last until late 2013, would allow the city to begin talks with the union over changing the firefighters' pension plan. Under the current contract, the union has the right to refuse negotiating.

The new contract would also change the basics of how firefighters are paid. Automatic step raises would be suspended for two years, replaced by 2.5 percent annual raises across the board. Both cost the city about $140,000 a year, Roseto said.

In the third year, the step raises would return under more constrained terms. The raises, which now continue even after the contract expires, would instead stop at the contract's end, saving the city money if the union and city again reached an impasse.

The city had also pushed to expand the firefighters' average workweek from 53 to 56 hours. In a nine-day cycle, firefighters work three 24-hour shifts and have six days off, earning an extra vacation day after every 18th shift.

Those days, the city argued, forced officials to hire nine more firefighters and paramedics to cover off time, at a cost of $400,000 a year. The city ultimately conceded.

The union, International Association of Firefighters Local 1158, represents Clearwater's 180 firefighters, paramedics and lieutenants. Clearwater Fire Rescue's various division chiefs and assistant chiefs are not unionized.

Though DeVivo said "it was a shame" the deal had gone to impasse, he was pleased that "a deal that's good for both sides" had been found

"For several months, I made the comment … 'Let's go old school. Let's lock the door and nobody leave until we hash out a deal,' " DeVivo said. "And that's what we did Monday."

City Manager Bill Horne agreed, saying, "We have to celebrate the mere fact that we came to an agreement. That's something that has been elusive for us for quite a while."

Ultimately, the union members will decide how far the agreement can go. If they ratify it, the deal will go to the City Council for approval. If they don't, both sides will have to again plead their case before the special magistrate.

"I'm excited about making some progress, but ultimately, there are still steps that have to occur," Mayor Frank Hibbard said. "I'll wait for that … before I start celebrating."

There is a reason why the air in Tampa Bay is filled with playoff talk. If Thursday night's 12-8 Bucs preseason win over the Jaguars is any indication, it's also going to be filled with footballs thrown by quarterback Jameis Winston.