SPRINGFIELD — The Illinois Legislature approved a historic plan Tuesday to eliminate the state's $100 billion pension shortfall, with a vote that drew threats of a legal challenge from labor unions but that supporters said was crucial to repairing Illinois' deeply troubled finances.

The House voted 62-53 in favor of the plan, sending it to Gov. Pat Quinn, who has said he will sign it. The Senate approved the measure 30-24 just minutes earlier.

"The message is this is not a one-sided bill. There will be changes here, much-needed changes, but this bill is a well thought out, well balanced bill that deserves the support of this body, the state Senate and the approval of Gov. Quinn," House Speaker Michael Madigan said at the start of the House debate. "Something's got to be done. We can't go on dedicating so much of our resources to this one sector of pensions."

Public employee unions, who oppose the bill, vowed to quickly take legal action. They say the legislation is unfair to workers and retirees who for years made faithful contributions to retirement systems but now will see benefits cut because of government mismanagement. They also argue parts of the measure are unconstitutional.

Illinois' unfunded pension problem is considered the worst in the nation, primarily because lawmakers failed for decades to make the state's full payments to the funds. The massive unfunded liability has led the major credit rating agencies to downgrade Illinois' rating to the lowest of any state in the nation. It's also siphoned money from education, roads and other areas.

Yet for years, lawmakers have been unable to agree on how to fix the problem.

The measure approved Tuesday emerged last week following negotiations by a bipartisan pension conference committee and then meetings of Illinois' legislative leaders. They say it will save the state $160 billion over 30 years and fully fund the systems by 2044.

It would push back the retirement age for workers ages 45 and younger, on a sliding scale. The annual 3 percent cost-of-living increases for retirees would be replaced with a system that only provides the increases on a portion of benefits, based on how many years a beneficiary was in their job. Some workers would have the option of freezing their pension and starting a 401(k)-style defined contribution plan.

Workers will contribute 1 percent less to their own retirement under the plan. Legislative leaders say they included that provision, as well as language that says the retirement systems may sue the state if it doesn't make its annual payments, in hopes of boosting the measure's odds of surviving the unions' anticipated court challenge.

Quinn and the legislative leaders reached out to a number of lawmakers over recent days, urging them to support the bill.

In addition to the labor unions, some Republicans said they opposed the bill because it didn't cut benefits enough. Other opponents said there wasn't sufficient time for lawmakers and the public to review it.