May 1 (Reuters) - Ratings agency Moody's revised Brazil's outlook to positive from stable on Wednesday, citing stronger economic growth while maintaining the Ba2 credit rating for the country.

The Finance Ministry highlighted that this marks Moody's first adjustment since 2018, when Brazil's outlook transitioned from negative to stable, celebrating the news in a statement following credit upgrades by S&P and Fitch in 2023.

The ministry stressed President Luiz Inacio Lula da Silva's commitment to pursuing a sustainable path for public finances, "combining efforts to enhance revenue and control expenditure dynamics."

Moody's forecast a gross domestic product (GDP) expansion of around 2% for both this year and the next, attributing the more robust outlook for economic activity compared to pre-pandemic years to structural reforms enacted across various administrations and institutional frameworks that reduce uncertainty regarding future policy directions.

The agency also pointed out the ongoing, albeit gradual, fiscal consolidation that could potentially stabilize Latin America's largest economy's public debt.

However, Moody's cautioned that risks persist, emphasizing that Brazil's unchanged Ba2 credit rating, below investment grade, reflects its "still relatively weak fiscal strength," with a high debt burden susceptible to economic or financial shocks.

Brazil remains two steps away from attaining Moody's, S&P, and Fitch's investment-grade rating. A superior rating reflects enhanced creditworthiness, allowing nations to issue debt at reduced interest rates.

Brazil received an investment-grade rating for the first time in 2008 but relinquished it by early 2016 as the global commodity market boom waned, and the country encountered a succession of domestic and international crises.

Finance Minister Fernando Haddad wrote on social media platform X that the country is recovering its economic, social, and environmental credibility despite the global economic deterioration scenario, adding, "We have much to do." (Reporting by Marcela Ayres; Editing by Josie Kao and David Gregorio)