A Wall Street rating agency raised warning flags Thursday about Mayor Rahm Emanuel’s stalled, $10 billion pension borrowing and about the long-term viability of his feel-good election-year budget.

Standard & Poor’s warned that “circumstances that surround” the issuance of pension obligation bonds “as well as the new debt itself could have implications for the [city’s] creditworthiness.”

Chicago’s bond rating with Standard & Poor’s currently stands at BBB+ with a stable outlook.

But that could change if Emanuel forges ahead with a pension borrowing that has been put on hold until after the City Council approves the mayor’s final budget.

“S&P Global Ratings views POB issuances in environments of fiscal distress or as a mechanism for short-term budget relief as a negative credit factor,” the report states.

“Depending on the structure [of the pension borrowing] and whether or not the city would make changes to its pension funding discipline, issuances could have rating implications for Chicago.”

That’s not the only red flag waved by the Wall Street rating agency.

Standard & Poor’s also raised concerns about the problems Emanuel chose to ignore in his eighth and final budget.

They include: a $1 billion spike in pension payments that will confront the new mayor and City Council; police and fire contracts yet to be negotiated that will undoubtedly include tens of millions of dollars in retroactive pay increases to cover raises dating back to June 30, 2017 and rising debt service costs.

“The city has yet to identify funding sources for a large increase in police and fire pension contributions in 2020 and we anticipate that new police and fire labor contracts will grow wage expenses beyond baseline assumptions presented in the city’s annual financial analysis,” the rating agency wrote.

“We still view structural solutions to close the fiscal 2020 gap as feasible. But a change in political will (particularly uncertain in light of pending administration changes) and further increases to the budget gap, including escalation of pension costs, could change our view.”

Although an avalanche of tax increases and spending cuts “set up fiscal 2019 to be an easier budget,” the next three years will “test the city’s willingness and ability to manage its budget in a sustainable manner,” the rating agency said.

After a five-year ramp up to actuarial funding, beleaguered Chicago taxpayers will be on the hook to keep all four city employee pension funds on the road to 90 percent funding over the next 40 years.

The lengthy amortization period “amounts to a form of contribution deferral that adds substantial long-term risk,” Standard & Poor’s wrote.

“The city will be locked into negative amortization for several decades, meaning that the unfunded liability will continue to grow even as contributions increase and the plans will remain vulnerable to adverse experience and at risk of insolvency in a recession or market downturn,” the report states.

Kristen Cabanban, a spokesperson for the city’s Office of Budget and Management, argued that the S&P report “confirms what the Mayor said” in his final budget address.

“Because of the fiscal discipline exercised by the City to address its legacy liabilities and finding a dedicated revenue stream to finance our four pension funds, the city has the smallest structural deficit in more than a decade,” Cabanan wrote in an email.

Earlier this week, Emanuel basked in the glow of a 2019 budget that, he hopes, solidifies his legacy as Chicago’s financial savior.

Thanks to tough decisions already made, the $10.66 billion holds the line on new taxes, fines and fees and still invests heavily in police reform, crime-fighting, housekeeping services, mentoring and summer jobs for at-risk youth.

That means the mayor’s City Council allies get a pass during an election year, just as they did four years ago, when Emanuel’s name was still on the ballot.

In December, the mayor has promised to lay out a pension plan that includes “options” to soften the blow of another painful round of post-election tax increases.

Emanuel has repeatedly refused to say whether the solution he seeks will include the $10 billion pension borrowing or whether he will give a reluctant City Council the option of approving even more tax increases.