One of the nation’s top credit rating agency gave high marks to Los Angeles Friday for its financial management and how its outlook has improved coming out of the recession.

Moody’s Investor Services, whose reports can influence how much a city pays for credit it is seeking, said L.A. has been able to reverse its problems and its lease ratings have gone up to A1 from A2. The city’s general obligation bond ratings remain at Aa2.

“The second largest city in the U.S. is well positioned to strengthen its strong credit profile, given a resilient and growing tax base, a highly diverse economy and gradually growing reserves,” the report said.

A spokesman for Mayor Eric Garcetti pointed out the findings affirm what the mayor has been doing over the past 18 months.

“This is where our commitment to fiscal discipline pays off for L.A. residents,” spokesman Yusef Robb said. “Higher credit ratings mean less spending on interest payments and greater investments in our neighborhoods.”

Among the issues cited by Moody’s were negotiated and voter-approved changes in pension, a reduction in the size of the city workforce, higher employee contributions for pensions, health care and the city’s reserve fund.

City Administrative Officer Miguel Santana said the report reflects the work the city has done over the past several years.

“It has been a lot of hard work and tough decisions by our policy makers,” Santana said. “We have been helped by the unions and the residents who have been through a sustained difficult time.”

If the city continues its discipline, he believes it can rid itself of its structural deficit by 2018 or 2019.

Moody’s said the city has benefited from its diverse tax base while reducing its fixed costs on pensions and retiree health benefits.

Leading the way for the city has been the recovery of home values, which now are at a median $585,000, only 4 percent less than its pre-recession high.

There also has been significant job growth, Moody’s said, in technology, tourism, trade and professional-services areas.

“Technology companies in the Los Angeles metro area have raised $620 million in nearly 50 transactions, a value that is 78 percent higher than the previous year,” Moody’s said.

“The city’s employment trends are improving though still lag at the state and national levels,” the report said. “Positively, the gap between the city and the nation’s unemployment rate is closing.”

At the same time, Moody’s credited the city with reducing the size of its workforce by 5,000 employees, bringing the city’s employment levels it has not had since the 1990s.

Other factors helping the city in its recovery are continued increases in the hotel bed tax and the documentary transfer tax.

Moody’s said the city has had a strong financial plan in place for the past four years, enabling it to cover deficits and end each year with a surplus.