Illinois had its credit rating upgraded for a third time in less than a year as rebounding revenue helped it pay down debts and federal aid eased some of the pain from the pandemic for the still lowest-rated U.S. state.

Moody’s Investors Service on Thursday raised the state to Baa1 from Baa2 with a stable outlook, leaving it three levels above junk status. It last lifted the state in June and S&P Global Ratings followed in July by bumping Illinois up to BBB from BBB-. Both upgrades were the first for the state in two decades.

“The upgrade to Baa1 reflects the state’s solid tax revenue growth over the past year, which expanded its capacity to rebuild financial reserves and increase payments towards unfunded liabilities,” Moody’s analyst Matthew Butler said in a report on Thursday. “The state is on track to close the current fiscal 2022 with its strongest fund balance in over a decade.

Illinois has made strides in recent years toward shoring up its finances, aided in part by billions in federal aid. It has paid back its borrowing from the U.S. Federal Reserve’s Municipal Liquidity Facility and has reduced its unpaid bill backlog. The state is also increasing pension contributions and rebuilding its rainy-day fund.

Still, Moody’s noted that its rating balances recent financial progress with underlying challenges such as “heavy long-term liability and fixed cost burdens” and an economy that has expanded at a slower pace than peers. Illinois’s unfunded pension liability for its retirement systems stands at about $130 billion.

A credit upgrade means Illinois’s interest-rate costs could decline, saving taxpayers millions over years that could be used instead for education, health care and public safety, Illinois Governor J.B. Pritzker, a billionaire Democrat seeking a second term in November, said during a press conference on Thursday. Illinois currently pays the highest penalty above benchmark AAA municipal securities tracked by Bloomberg.

“There is more work to be done, of course, but step by step, rung by rung we are steadily climbing the ladder out of the hole that was dug over decades,” Pritzker said.

This article was provided by Bloomberg News.