A key credit ratings agency has boosted its outlook for Illinois, pointing to the passage of the state budget last week — a move Democratic legislative leaders said shows the long-awaited spending plan was “an important step in the right direction.”

S&P Global Ratings said the budget deal “reduces the near-term uncertainty” surrounding state finances, while still worrying about a “disconcerting lack of consensus among state officials on the way forward.”

“S&P’s action today is a strong signal that the balanced budget enacted by Republicans and Democrats is an important step in the right direction,” Speaker Mike Madigan said.

State Senate President John Cullerton’s office said the credit rating agency’s analysis shows the budget is moving “the state toward the stability it desperately needs.”

In a news release, S&P Global Ratings said: “Through a combination of spending cuts and tax increases, the budget package brings the state’s revenue and expenditure base much closer to structural alignment and reduces the near-term uncertainty that had come to characterize its financial operations.”

But S&P Global Ratings also said the state would “almost certainly suffer an extended fiscal hangover from the impasse, not least from its record level of unpaid bills, which will be a drain on its future resources.”

The agency affirmed its BBB- rating for the state’s general obligation bonds, the BB+ ratings on the state’s appropriation-backed debt and the BB- ratings on the state’s moral obligation-backed debt, according to the release.

“And in our view, balanced fiscal operations are for Illinois a necessary precondition to improving its prospects for longer term solvency,” according to the release. “Still, it is largely because of the bill backlog, poorly funded pension systems and on-going political dysfunction that the state’s rating is well below that of peer-comparison states with similar economic profiles.”

Cullerton and Madigan released statements after the news.

“The point of this balanced budget was to end the chaos and move the state toward the stability it desperately needs,” said Cullerton spokesman John Patterson.

“Those efforts appear to have been recognized and appreciated. The Senate President remains committed to working together to overcome the challenges we face and to remind everyone just how great the state of Illinois is.”

Madigan said:At the end of June, I wrote to the rating agencies and asked that they temporarily withhold judgment and give legislators more time to enact a budget, and I’m grateful for the legislators on both sides of the aisle who used this time to work together and make the difficult decisions needed to start getting Illinois back on track.

“There is more work to be done, and it’s clear from S&P’s statement that rating agencies, like all Illinois residents, are hoping Governor Rauner will work in good faith with legislators to address these challenges rather than rejecting compromise by turning further to the extreme right.”