Donald Trump has exempted Hungary from sanctions over its continued purchases of Russian oil and gas for one year, a White House official has confirmed to BBC News.

Earlier, the US president said he would consider an opt-out for Hungarian Prime Minister Viktor Orban, a close Trump ally who has maintained good relations with Russia throughout the Ukraine war.

Speaking on Friday during Orban's visit to the White House, Trump said an exemption was under consideration because it's very difficult for him [Orban] to get the oil and gas from other areas.

It comes after the US effectively blacklisted two of Russia's largest oil companies last month, threatening sanctions on those who buy from them.

Following the meeting, Hungarian Foreign Minister Péter Szijjártó wrote on X that the US had given Budapest a full and unlimited exemption from sanctions on oil and gas. An official later clarified that the exemption was time-limited to one year.

This decision by Trump marks a major victory for Orban, who had said the sanctions would ruin his country's economy. During the public part of the meeting, Trump appeared sympathetic to Hungary's position as a landlocked country dependent on Russian oil and gas, but stopped short of providing a specific guarantee.

However, it subsequently became clear that the US president had granted an exemption for one year—contradicting his earlier commitment to penalize entities associated with Russian energy companies.

Hungary has agreed to buy several hundred million dollars worth of US natural gas as part of the arrangement, a deal likely to provoke backlash among European nations that have been critical of Hungary’s close ties with Moscow.

Orban has fostered this relationship to win support among voters, promising them cheap Russian energy amidst rising political challenges leading to elections next April.

Trump stated that while Hungary faced unique logistical challenges regarding energy sourcing, he expressed his displeasure with other European nations that still purchase Russian commodities, emphasizing that Hungary's situation is distinct.

The leaders discussed the ongoing war in Ukraine during their first formal meeting since Trump returned to power, including the prospect of negotiating with Putin. Orban asserted that only their nations genuinely desired peace in Ukraine, criticizing other governments for continuing the conflict in hopes of a Ukrainian victory.

Amidst these discussions, Hungary's export-driven car industry has faced challenges due to Trump's tariffs on European goods, exacerbating economic strains. Despite frequent disagreements with EU officials over various governance issues, Trump encouraged European nations to strongly respect this leader for his immigration stance.

With additional reporting by Nick Thorpe