For the first time since 1977, the Philadelphia School District has lost its junk-bond credit rating.

Moody’s Investors Service on Tuesday boosted the district’s rating two levels with a stable outlook, vaulting the school system into a position it hadn’t held in 41 years.

“This is an investment-grade rating,” said David Jacobson, Moody’s spokesman. “This is very good news.”

The rating change affects $3.2 billion in outstanding School District debt. It means the district will be able to get financing at lower rates, which in the end should save it — and taxpayers — money.

Moody’s cited local control and the newly appointed school board as chief drivers of the improved rating. And despite some push and pull between Mayor Kenney and City Council over the district’s long-term funding — Kenney initially proposed a property-tax hike to pay for schools, which Council resisted — Moody’s said the promised $547 million in new funds “largely eliminates the district’s previously projected deficits over the next five years.”

Philadelphia’s improved economy also drove the credit upgrade; roughly 40 percent of the district’s revenue comes from the city.

The School District, one of the country’s largest, has about 130,000 students in over 200 schools, with nearly 75,000 more in charters. It has an annual budget of more $3 billion, but lacks authority to raise its own revenue. After a painful stretch marked by deficits and cuts to program and staff, the district has now marked three years with operating surpluses.

Moody’s cited “a very strong management team, which has developed a detailed understanding not only of the district’s finances but also the ongoing operational complexities of managing a highly dynamic, large, urban school district.”

It also noted that the district’s charter enrollment has stabilized, with about a third of all city public school students in charters.

On the down side, the agency noted a “relatively narrow fund balance that is not anticipated to improve materially in the near term,” and operating deficits on the horizon for 2020.

Uri Monson, the district’s chief financial officer, said that a two-rating jump was unusual, and that for a school district that too often deals with bad news, it felt particularly important.

“It’s a significant psychological jump,” said Monson. “We’ve shown that we can be responsible stewards of public money.”

The district is now seen as a better credit risk, and its investment-grade status means that a number of mutual funds that avoid junk bonds can now buy its bonds.

The ratings boost will not have an immediate impact, but will give the district a boost when it next borrows money. Because of the timing of state aid, it typically does so every July. This past summer, for instance, the district borrowed $450 million.

“If we’re even paying 1 percent less, that’s millions of dollars in interest savings,” said Monson.

That money can then be reinvested into schools, he said.

Superintendent William R. Hite Jr. said in a statement that the upgrade reflects the district’s years of steady work toward fiscal stability and means that “our schools and students can rely on continued investments without the uncertainty of sudden cuts in services."