"The negative outlook reflects an at least one-in-three chance of a downgrade over the next two years if Hungary's economic or fiscal profile significantly worsens beyond our base case," S&P said.

In its rationale for the revision of the outlook, S&P pointed to risks that external pressures "could significantly weaken Hungary's economic and fiscal outcomes", citing the country's energy supply, especially from Russian sources, and "political tensions" with the European Commission.

S&P acknowledged that downside risks to growth related to energy security exist for many European countries but said they are more elevated for Hungary, considering its "particularly high" energy import dependence and its energy-intensive economy. The rating agency added that it would be "extremely difficult" for Hungary to fully diversify away from Russian energy imports in the near term.

Potential cuts or substantial delays in the transfer of European Union funding to Hungary is another risk to the country's growth outlook, S&P said, noting a delay of the country's Recovery and Resilience Facility (RRF) funding "due to political concerns" and the launch of a Rule of Law Conditionality Mechanism.

"We remain of the opinion that Hungary will ultimately be able to access RRF funds and that cuts from the application of the conditionality mechanism, should any occur, will be largely symbolic in nature," S&P said, also pointing out "the increasing willingness of the Hungarian government to reach compromises with the EC on key policy items over the past weeks".

S&P put Hungary's 2022 GDP growth at around 5.1%, supported by strong domestic demand in the first half, and projected a moderation to about 2% in 2023. An alternative scenario of a sudden stop in gas imports and/or cuts to EU transfers could cause Hungary's open economy to contract in 2023, it added.

The agency said Hungary's long-term growth potential will likely remain constrained by structural challenges, such as public sector predominance in many economic areas, low productivity, an aging and declining working age population, a chronic skills shortage, and labor shortages that could result in continued rapid wage growth.

S&P recognized that the government has "substantially decreased" fiscal deficits in recent months and put the full-year gap at around 5% of GDP for 2022, while projecting a reduction to 3.5-4% in 2023. However, Hungary's state debt relative to GDP will remain one of the highest among its CEE peers at about 68% in 2022, it added.

"Despite the relatively heavy debt burden and rising interest rates domestically and globally, we see no immediate funding pressure. The government has access to a broad array of tested domestic and foreign financing," S&P said.

S&P said it could lower Hungary's rating "if significant delays or substantial cuts to EU funds occur or the supply of energy to the country is meaningfully constrained", which could weaken economic prospects and result in a deviation from the government's current fiscal consolidation strategy.

The outlook on Hungary's rating could be revised back to stable "if external pressures remain manageable, allowing GDP growth to recover and improved fiscal outcomes over our forecast period to 2025", it added.