Ukraine and Hungary expelled two diplomats each on Friday in an escalating row sparked by Kyiv's detention of two people it alleged were spying for Budapest.
Relations between Kyiv and Budapest have become strained in recent years, with Hungary's nationalist leader Viktor Orban voicing support for Moscow after it invaded Ukraine in 2022 and Budapest blocking Kyiv's efforts to join the European Union.
Ukraine's SBU security service said on Friday it had detained two alleged Hungarian spies it accused of gathering intelligence, including the location of air defence systems, in the western Zakarpattia region bordering Hungary.
"For the first time in Ukraine's history, the Security Service has exposed a Hungarian military intelligence network that was conducting espionage activities to the detriment of our state," the SBU said in a statement, adding that "two agents" had been detained.
The SBU said the suspects were a 40-year-old man and a woman, both ex-soldiers, and that they were supervised by a Hungarian intelligence officer.
They both now face up to life in prison, it added.
Hungary reacted by expelling "two spies working under diplomatic cover at the Ukrainian Embassy in Budapest," according to Hungarian Foreign Minister Peter Szijjarto.
He slammed Ukraine's investigation as "the latest smear campaign".
"We will not tolerate the constant launching of such smear campaigns against Hungary and the Hungarian people in Ukraine," Szijjarto said in a video posted on Facebook, slamming "growing anti-Hungarian propaganda".
Ukraine responded by expelling two of Hungary's diplomats.
Ukraine's security service alleged the man it suspected of spying had received cash from a Hungarian officer and tried to recruit at least two people as informants.
Apart from gathering information about the military, the agents also had to study "the socio-political views of local residents, in particular, scenarios of their behaviour if Hungarian troops entered the region", the secret service added.
According to the last official census in 2001, around 150,000 ethnic Hungarians lived in Ukraine's Zakarpattia region.