Mayor Bill de Blasio's 9-year contract agreement with the United Federation of Teachers, including a pair of 4 percent base-salary increases retroactive to the fall of 2008, will cost so much that he wants to defer some of the expense all the way out to the end of the decade.

Assuming it leads to a similar deal with other city unions, the UFT contract -- including a last retro installment in 2020, two years after the pact expires -- could boost the city's cumulative projected budget gaps to $7.6 billion by 2018.

Former Mayor Michael Bloomberg was right: Having depleted past surpluses, the city simply couldn't afford UFT's demands for billions in retroactive pay.

But the teachers' expectations didn't arise in a vacuum. In fact, it was Bloomberg who unwisely stoked them in the first place.

Those 4 percent pay increases for the 2008-10 contract cycle can be traced back to Bloomberg's deal with Local 237 of the Teamsters union -- announced on Sept. 16, 2008. As he made clear that day, the mayor intended the Teamsters contract with those increases to set the pattern for all other union pacts due to expire in the following months.

But Sept. 16, 2008, wasn't a typical late-summer day in New York. Just 24 hours earlier, Lehman Brothers had gone bankrupt, accelerating a full-blown panic on Wall Street. While the city's negotiations with the Teamsters had been going on for months, the financial meltdown should have brought an immediate halt to business as usual.

Despite the very real risk of a prolonged deflationary depression, Bloomberg -- planning a third-term race in 2009 -- put labor peace and predictability over fiscal prudence.

The UFT, feuding with the mayor on a variety of issues, was the only municipal union to reject two 4 percent raises during the 2008-10 contract cycle. In June 2010, Bloomberg withdrew his offer to the teachers, announcing he would spend the money to prevent UFT layoffs instead.

The budget surpluses accumulated by Bloomberg in good years are the only reason de Blasio can even pretend now that the UFT deal is affordable. But if the teacher contract helps break the budget in the future, Bloomberg will also deserve a good share of the blame.

E.J. McMahon is president of the Empire Center for Public Policy and senior fellow with the Manhattan Institute.