Earlier, the US president had said he would consider granting an exemption to Hungarian Prime Minister Viktor Orban, a close ally of Trump who has maintained good relations with Russia throughout the Ukraine war.
Speaking during Orban's White House visit on Friday, Trump said the exemption was being considered because "it's very difficult for him [Orban] to get oil and gas from other areas."
The move comes after the US last month blacklisted two of Russia's largest oil companies and threatened to sanction companies that buy oil from them.
Following the meeting, Hungarian Foreign Minister Peter Szijjarto wrote on X that the US had granted Budapest a "complete and unlimited exemption from sanctions on oil and gas."
An official later clarified that the exemption is for a period of one year.
Trump's decision is a major victory for Orban, who had said that sanctions would cripple his country's economy.
In the public portion of the meeting, Trump expressed sympathy for Hungary's situation as a landlocked country dependent on Russian oil and gas, but did not offer any specific guarantees.
But it later became clear that the US president had granted a one-year exemption – a move that seems to contradict his stated determination two weeks earlier to punish anyone doing business with Russian energy companies.
Under the agreement, Hungary has agreed to purchase several hundred million dollars worth of US natural gas, but the deal is likely to be poorly received in several European countries, most of which have long opposed Hungary's friendly stance towards Moscow. Orbán has long been a close personal and political ally of the former president, and largely echoes Donald Trump's populist right-wing rhetoric on immigration and social issues. This loyalty appears to have earned the Hungarian prime minister special favor at a time when he is facing a tough election in the spring.
Trump went on to say that Hungary faces unique logistical challenges, including a lack of access to a sea that could be used to extract oil, but that he is "very upset" with other European countries that, according to him, continue to buy Russian goods despite not being landlocked.
Orbán, one of Trump's closest allies in Europe and who has long opposed the European Union's efforts to pressure Moscow over Ukraine, defended his country's energy ties with Russia on Friday, saying that pipelines are neither "ideological" nor "political," but rather a "physical reality" due to the lack of ports.
He is using his country's heavy reliance on Russian oil and gas as a means of maintaining good relations with Moscow, as well as a platform on which he hopes to win re-election in Hungary next April. He has promised voters "cheap Russian energy."
Trump and Orbán also discussed the war in Ukraine on Friday – their first formal talks since Trump left office – including the possibility of negotiations with Putin.
"He [Orbán] understands Putin very well and knows him very well... I think Viktor feels that we're going to end that war very quickly," Trump said.
Meanwhile, the Hungarian leader said that only their two countries truly want peace in Ukraine.
"All the other governments prefer to continue the war because many of them think that Ukraine can win on the front lines, which is a misunderstanding of the situation." Trump asked him: "So you would say that Ukraine cannot win that war?" To which Orbán replied: "You know, miracles can happen."
Besides the issue of oil and gas sanctions, Hungary's export-driven car industry has been hit by Trump's tariffs on European goods, further weakening an already fragile economy.
Despite his ongoing clashes with EU leaders over migration, democracy, and the rule of law, Trump urged Europe to "respect this leader very, very strongly because he has been right on the issue of immigration."