A hidden-camera video of a citizenship ceremony that appears to show Ukrainians pledging allegiance to Hungary has triggered a treason investigation in a country grappling with Russia's annexation of Crimea and currently at war with Moscow-backed separatists.

Ukraine's constitution bars people from holding multiple citizenships.

The footage purportedly shows Ukrainians singing the Hungarian national anthem and taking a citizenship oath at the Hungarian Consulate in Berehove, a Ukrainian town of 24,000 near the border.

They are then told not to show their new Hungarian passports at the Ukrainian border by people who appear to be consular staff.

The issue of foreign passports being handed out in a region with a strong ethnic enclave is especially sensitive in Ukraine. Years before Crimea was annexed by Moscow in 2014,high-ranking Ukrainian officials alleged that Russian passports were being given out to local residents.

Ukrainian Foreign Minister Pavlo Klimkin sees Moscow’s hand behind the alleged Hungarian meddling, which he believes is aiming to “destabilize the region and Ukraine in general.” While Hungary is in the European Union and a NATO member, Prime Minister Viktor Orban has an amicable relationship with Russian President Vladimir Putin.

Ukraine is due to go to the polls in March. It has been trying to strengthen ties with the West since its pro-Russian government was toppled in 2014.

Klimkin didn’t provide any evidence of Russia’s alleged involvement. However, he called what happened in the video a national security "challenge" for Ukraine.

NBC News was not able to independently verify the veracity of the video, which first appeared on YouTube in September.

However, the footage is being investigated by Ukraine’s security services. It also prompted tit-for-tat expulsions of diplomats from both countries last month.

An estimated 150,000 ethnic Hungarians live in the Zakarpattia region on the western border of Ukraine, a former part of Austro-Hungarian Empire. Berehove, or Beregszász as it’s known in Hungarian, is a hub of Hungarian culture in the region. Nearly half of the town's residents identify as Hungarian.

Local residents walk on the street in Berehove, a hub of Hungarian culture in Ukraine's Zakarpattia region. Street signs are often written in both Ukrainian and Hungarian. Oleksandr Rupeta / Alamy file

Relations have been testy between Budapest and Kyiv since the fall of 2017, when an education law passed by Ukraine angered Hungarian officials. The law mandates that Ukrainian language be used exclusively in secondary schools, even in the country's ethnic enclaves, to help minorities integrate.

But Hungary saw the move as a violation of minority rights.

Budapest's actions to undermine Ukraine’s cohesion is "pressure from another flank on Kyiv,” said Orysia Lutsevych, a research fellow with the London-based Chatham House think tank.

“This is a new pressure point for Ukraine,” Lutsevych added, warning that the situation could "get out of control."

Hungary has denied any wrongdoing.

“Dual nationality is everyday practice within the E.U., and accordingly the Ukrainian objections do not indicate that Kyiv is serious about European integration and joining NATO," Hungarian Foreign Minister Peter Szijjárto said after the video emerged.

Ukrainian officials believe more than 100,000 Hungarian passports have been handed out to Ukrainian citizens of Hungarian descent in Zakarpattia in recent years.

Orban, who is known for his strong anti-migrant stance and tight control of the media, has openly condemned Western sanctions against Russia and accused the E.U. of having a “one-sided” policy towards Moscow.

Hungarian Prime Minister Victor Orban has been in power since 2010. Michaela Rehle / Reuters file

“The changing nature of Hungarian government with Orban being more aligned with autocracy and having links or a kind of common understanding with the Kremlin and Putin, suddenly makes Ukraine very nervous about Hungarian policy in Zakarpattia,” Lutsevych said.

But that policy goes back decades, according to Balazs Jarabik, a non-resident scholar at the Carnegie Endowment for International Peace.

After losing much of its territory in the aftermath of World War I, Hungary has long tried to engage with and protect its ethnic communities abroad.

Jozsef Antall, the first democratically elected Hungarian prime minister, famously stated in 1990 that he considered himself the leader of 15 million Hungarians — not only the 10 million living within its borders.

In 2011, Hungary passed a law to make it easier for ethnic Hungarians living abroad to obtain citizenship. To date, more than one million Hungarian passports have been handed out to ethnic Hungarians in a handful of neighboring states — including Ukraine.

But despite Hungary’s cornerstone policy of building symbolic ties with its communities abroad, the video that emerged from Berehove doesn’t come across as a “kosher” practice to the government in Kyiv, according to Jarabik.

Even though Hungary maintains that the granting of passports in Berehove was legal, he says the political climate means it is being seen as a potential threat in Ukraine.

“For Ukrainians, this reminds them of Russian practices and anything that reminds Ukrainians of Russian practices is obviously a security challenge,” Jarabik said.

Hungarian officials have previously called suggestions that their policy in Zakarpattia is serving Russian interests "an abject lie."

Jarabik said Ukraine might be using the footage and diplomatic spat as a way to "mobilize patriotic voters."

He added: “Hungary has kind of become a sparring partner in this. And Hungary is not Russia ... Kyiv knows that there is no real threat from Hungary.”

Lutsevych says instead of engaging in a blame game with Budapest, Kyiv needs to build meaningful dialogue with ethnic Hungarians in Zakarpattia.

“Hungarian communities there are not willing to engage with Kyiv to discuss their problems,” Lutsevych said. “They are more willing to engage with Budapest and that’s not normal.”