Decades of pension shortchanging and years of political gridlock were shoved aside in six minutes when Illinois lawmakers -- first the Senate, then the House -- approved a $160 billion rescue of the worst-funded state pension system in the U.S.

The votes yesterday in the General Assembly provided a big step in the state’s effort to rehabilitate itself from years of mismanagement that led to the lowest credit rating of the 50 states, due largely to a pension shortfall of $100 billion.

While a legal challenge from unions has been promised, Democratic Governor Pat Quinn, who had repeatedly watched lawmakers ignore his calls to restructure the system, declared victory. Quinn has promised to sign the measure into law.

“This day will always go down in history as the day where the people of Illinois, through their elected representatives and senators, took action for the future,” Quinn said in a briefing for reporters after the vote. “The people have won. We have all won.”

If the measure survives a court battle, Illinois should emerge from worst-in-the-nation in pension funding status. While U.S. states have lost ground for five straight years in setting aside money for retired workers, Illinois was among five states where retirement-funding ratios fell at least 21 percentage points from 2007 to 2012, data compiled by Bloomberg show.

Go Time

The state Senate moved first, passing the measure 30-24. The House followed suit, capping almost three hours of debate with a 62-53 vote. The votes came after years of legislative frustration that produced larger shortfalls and bigger portions of annual state spending going to pay retirement obligations.

“We have a crisis; we have a problem,” said Representative Elaine Nekritz, a Democrat from Des Plaines and a member of the committee that developed the measure approved in Springfield. “We owe $100 billion. Illinois will be better tomorrow because of our actions today.”

Senator Kwame Raoul, a Chicago Democrat, said lawmakers had to act.

“Perfection is never achieved,” Raoul said from the Senate floor. “However, we have the worst unfunded liability in the United States of America and we can’t continue to be cemented into a stalemate.”

While many Republicans and a coalition of public-employee unions opposed the measure, they couldn’t block it. For the unions, a lawsuit is the next step, challenging the constitutionality of the pension changes.

“This is no victory for Illinois, but a dark day for its citizens and public servants,” said a statement from We Are One Illinois, a union coalition.

Constitutional Question

The vote followed days of lobbying that divided Democrats and Republicans alike. Unions that represent about 760,000 workers and retirees, in pledging to challenge the measure in court, claim it violates language in the Illinois constitution that says retirement benefits “shall not be diminished or impaired.”

Dan Montgomery, president of the Illinois Federation of Teachers, said opponents plan to make their legal challenge to the bill “as soon as we find it appropriate to be in court.”

“This so-called $160 billion of savings is illusory because this is not legal,” Montgomery told reporters. “We wanted to see a solution that would pass legal muster.”

The proposal agreed to by legislative leaders Nov. 27 was designed to limit annual cost-of-living allowances and raise the retirement age for some workers. That would produce the bulk of the $160 billion of savings over the next 30 years, according to the plan.

Too Tiny

To some Republicans, the measure didn’t go far enough in cutting costs.

“We don’t have time for small reform, but that is what is before us,” said Representative Jeanne Ives, a Republican from Wheaton. “This bill does not go big and it is not substantial or solid.”

Investors disagreed. The penalty on Illinois general- obligation bonds has declined since legislative leaders announced the tentative agreement last week. The yield spread on debt due in 10 years, relative to benchmark munis, fell to 1.7 percentage points Nov. 29, the lowest since August, according to data compiled by Bloomberg. A shrinking spread usually signals investor confidence that state finances will improve.

The most frequently traded Illinois pension-obligation debt changed hands today at an average yield of 6 percent, down from 6.1 percent yesterday, data compiled by Bloomberg show. On Nov. 29, it traded at 5.8 percent, the lowest since Aug. 1.

Sixth Try

Illinois plans to offer $350 million in general-obligation bonds next week in a competitive sale, John Sinsheimer, the state’s director of capital markets, has said. The governor said he hopes that rating companies and bond buyers will take note of the bill’s passage.

The bipartisan votes were born of the realization that the state couldn’t continue to run up deficits as its credit rating sank. Representative Darlene Senger, a Republican from Naperville, said Illinois would have been a laughingstock had lawmakers failed again to act.

It was their sixth attempt in 16 months to repair the system.