PROVIDENCE, R.I. (AP) — Rhode Island is taking dramatic steps toward fixing one of the nation's most underfunded public pension systems, but the true battle with public-sector unions may be just beginning. State lawmakers ignored jeers from public workers and the threat of a lawsuit Thursday to pass sweeping changes to the pension system covering 66,000 active and retired public workers. The legislation is designed to save billions of dollars in future years by backing away from promises to state and municipal workers that lawmakers say the state can no longer afford. Gov. Lincoln Chafee, an independent, said he will sign the bill. Public-sector union leaders promised a court challenge before the final votes were even cast. "The attorneys are going to make a lot of money," Philip Keefe, president of Local 580, which represents social service, administrative and technical workers. "If this is overturned, it will be you, me and every other taxpayer that is on the hook for billions." Supporters acknowledged that a lawsuit was inevitable but said the bill was thoroughly reviewed for any legal problems. Supporters said one of the reasons for the bill was to ensure there's money available when today's workers retire. "It would certainly be a lot easier to walk away from this reform," said Senate President Teresa Paiva Weed, D-Newport. "However, it is clear that doing nothing only puts our retirees and our active members' benefits at greater risk. We owe it to them, as well as to all other taxpayers, to attack this challenge head on." The landmark legislation could have big implications around the nation. Nearly every state is confronting the same problem, caused by escalating pension costs, huge investment losses and recession-induced budget deficits. The Pew Center on the States released a report earlier this year that found that states face a collective gap of $1.26 trillion between what they've promised public workers and what they have set aside to meet those promises. Rhode Island needs $7 billion to fully fund the pension fund that covers state workers and many municipal employees — roughly the same amount as the state's entire annual budget. Under the current system, the state must pour more and more into the pension system annually, from $319 million in 2011 to $765 million in 2015 and $1.3 billion in 2028. The pension system covers active and retired public teachers, state employees, judges and many municipal workers. Fifty-eight percent of retired teachers and 48 percent of retired state workers receive more money in their pensions than they did in their final years of work. Their benefits are set by state law and not collective bargaining. The legislation passed Thursday would suspend automatic, annual pension increases for retirees for five years, and then award them only if pension investments perform well. The bill also raises retirement ages for many workers and creates a benefit plan that mixes pensions with 401(k)-style accounts. The changes wouldn't apply to municipal pension plans, which are typically the result of collective bargaining. The measure is projected to reduce the state's unfunded pension liability by $3 billion immediately, and save taxpayers $4 billion over 25 years. Public workers said they felt betrayed and some interrupted Thursday's debate with jeers. "They should be ashamed of themselves," said Dean Brockway, a Cranston firefighter with 28 years on the job. "These were Democrats voting to do this. They're trying to solve a 40-year-old problem in one day. They didn't have to do this." Frustrated opponents in the legislature warned their colleagues that the bill may come back to haunt them if the courts side with workers. "What we are about to do is a crime," said Rep. Scott Guthrie, D-Coventry, himself a retired firefighter. "You want this thing to linger around for 10, 15 years? You want to go through 10 years of litigation? You want to spend God knows how much money on legal fees?" The state's public-sector unions won a key victory in September when a judge ruled that pension agreements are a contract between the state and its employees and cannot be taken away arbitrarily. The state is appealing that ruling. Supporters of the bill, however, note that the ruling says contracts may be altered if there is a good reason to do so. While the bill's fate may be decided in the courts, its passage represents a political win for legislative leaders, Chafee and Treasurer Gina Raimondo, a Democrat who was the main architect of the legislation. For months, Chafee and Raimondo warned that unless the state reined in pension costs, lawmakers would have to raise taxes and slash funds for education and other services. "Rhode Island has demonstrated to the rest of the country that we are committed to getting our fiscal house in order," Chafee said in a statement. Several lawmakers said they supported the bill with great reluctance, noting that they were voting to withhold money that retired workers were counting on. Rep. Donna Walsh, D-Charlestown, said it was the "most heart-wrenching, gut-wrenching vote" she has cast in 12 years in the General Assembly. "It may be necessary, but it certainly is not fair," said Rep. John Savage, R-East Providence. "Can we honestly say to our state workers, to those who educate our children, to those who protect us... that this bill is fair? I don't think so." Democratic leaders said they understood that by tackling public pensions they would alienate public-sector unions, a long-standing ally. "Significant Democratic constituencies are very upset," said House Speaker Gordon Fox, D-Providence. But Fox said the General Assembly can no longer afford to "make promises we can't keep." A coalition formed by the state's business community helped push for the changes, which business leaders argued would help restore fiscal stability to state government and relieve the state's tax burden. Lawmakers said the state's stubbornly high unemployment rate of 10.5 percent helped convince them of the need for change. The state has intervened in the financial struggles of two cities, and a state-appointed receiver sought bankruptcy protection last fall for the insolvent city of Central Falls. Raimondo said it's not fair to ask taxpayers to pay for ever-increasing pensions for public workers when they may not be able to find a job themselves. "The average Rhode Islander is worse off than the average public employee," she said. "The average Rhode Islander is pretty strapped right now." Opponents of the bill pushed unsuccessfully to weaken its impact, but the bill passed easily nevertheless. The Senate passed its version of the legislation 35-2, with the House voting 57-15 a few hours later. The changes in the legislation would not apply to locally-run pension funds, many of which are in even worse shape than the state-run system. Chafee said he will introduce legislation in January to give cities and towns greater authority to curb their pension costs. Copyright 2011 The Associated Press.