Hungary says it has signed a deal with Russian energy giant Gazprom for 5.8 billion cubic metres of extra natural gas.
Zoltan Kovacs, international spokesman for Hungary's government, said it would be on top of the country's current supplies.
"Hungary’s energy supply is safe," he added.
Hungary's foreign affairs minister also announced the deal with Gazprom on Facebook during a break from his meeting with other EU ministers.
Péter Szijjártó specified that in September and October, Gazprom will deliver a maximum of 5.8 million cubic meters more natural gas per day to Hungary via Serbia than what was specified in its long-term contract.
EU foreign affairs ministers were meeting to debate a possible visa ban on Russian tourists in response to the war in Ukraine.
Szijjártó added that during the foreign affairs meeting, he spoke out against a possible visa ban on Russians.
The announcement comes as Europe scrambles to cut energy consumption and cope with a reduction in supply of Russian gas.
The Russian state-owned energy company had increased supplies to Hungary earlier this month even as it stopped flows to other European countries.
Gazprom stopped gas supplies to Europe's Nord Stream 1 pipeline earlier on Wednesday for maintenance. The company also said it had suspended gas flows to French gas company Engie "due to failure to pay for July supplies in full."
Hungarian Prime Minister Viktor Orban had previously indicated that he would sign an agreement with Russia to secure natural gas for the country. Foreign affairs minister Szijjártó travelled to Moscow in July to discuss a possible deal.
The government opposes any possible EU sanctions on natural gas from Russia.