THREE YEARS AGO, Maryland Gov. Martin O’Malley (D) made a deal with the state’s public-employee unions. Under its terms, state workers agreed to pay more of their salaries into Maryland’s underfunded pension system and accept lower benefits for new hires. In return, the state promised to devote $300 million annually from the resulting savings to shore up the pension fund, which at the time had less than two-thirds the amount it needed to make future payments.

Now Mr. O’Malley is trying to renege on the deal by grabbing back $100 million a year to plug a hole in the state’s budget deficit. By doing so, he is undercutting not only his credibility but also the state’s, and putting at risk Maryland’s coveted triple-A bond rating. That’s a bad idea, and lawmakers in Annapolis should reject it.

Maryland’s $40 billion pension fund is a vital lifeline for 138,000 retirees, who were paid almost $3 billion from it in the fiscal year that ended last summer. Like many states emerging from the recession a few years ago, Maryland was forced to find a fix for the fund, which had been battered by anemic stock market performance and years of cavalier underfunding. The 2011 deal set a course to restore it to relative good health by 2023.

We say “relative” good health because the deal was based on a goal — 80 percent of the total amount of obligations faced by the state — that constitutes a somewhat squishy definition of good health. Yet reaching even that goal would be pushed back to 2025 if Mr. O’Malley gets his way by shifting $100 million annually from the pension fund into the general budget.

The governor faces a dilemma familiar to many of his counterparts across the country. Pension obligations are long-term challenges that are subject to mathematical debate, while the requirement to set balanced budgets is immediate and obligatory. The temptation is enormous to dip into pension funds to plug current deficits.

Tempting or not, it’s unwise. As it is, Maryland’s timetable to restore the depleted pension fund is based on investment performance forecasts that, as in many states, may prove excessively sunny. The bond-rating agencies, which have smiled on Maryland until now, are likely to take a negative view of any move to chip away at the state’s commitment to its pension fund. If the agencies downgrade Maryland’s bonds even slightly, it will cost the state millions of dollars annually in higher interest payments. That’s not a risk the state should run.

Both Peter Franchot (D), Maryland’s comptroller, and Nancy K. Kopp, the treasurer, have warned lawmakers against adopting the governor’s proposal. Ms. Kopp, no one’s idea of a bomb thrower, correctly stressed that the state would be breaking its word. “It’s a question of trust, in all candor,” she told lawmakers last month. “We trusted $300 million, and now we’re told to trust $200 million.”