When Russian President Vladimir Putin visited Budapest on Wednesday, Hungarian Prime Minister Viktor Orban had a gift already wrapped: Hours before their joint press conference, Hungary vetoed a joint declaration of NATO ambassadors on Ukraine.

Hungary's veto effectively threw up a new obstacle to Ukraine's aspirations to build a closer relationship with the alliance. Officially, Hungary says such moves are about protecting the rights of ethnic Hungarians in Ukraine, CNN reports.

"The expression 'veto' is very harsh," said Hungarian government spokesperson Zoltán Kovács. "Let's say instead that we recommend further consideration. The debate was about the situation in Ukraine, where the ethnic Hungarian minority suffers legal discrimination."

A strident nationalist, Orban has often complained about the status of the Hungarian minority in western Ukraine. He has also cultivated a close relationship with Putin, and his government has frequently impeded Ukraine's overtures to the West, much to the Russian leader's satisfaction.

Five years ago, Orban said that ethnic Hungarians in western Ukraine must be granted dual citizenship and the opportunity for autonomy. "Ukraine can be neither stable nor democratic if it does not give its minorities, including Hungarians, their due," Orban said.

Standing alongside Putin in February 2017, Orban said "the current discussions about the language of instruction in Ukraine are far from beneficial for the Hungarian minority." Under Ukrainian law, school instruction in sixth grade and above is solely in Ukrainian.

Such statements are music to Putin's ears. Putin has defended his support for separatists in eastern Ukraine by drawing parallels with Hungary, saying that his order allowing residents of the Donestk and Luhansk regions of Ukraine to apply for Russian passports was similar to Hungary's desire to grant passports to ethnic Hungarians abroad. Ukraine's language laws have also been a justification for Russia's support to separatists in Ukraine's Donbas region.

Then--U.S. envoy to Ukraine Kurt Volker during his visit to Budapest in May said in an interview with Hungarian media there were two fundamental principles: the right of national minorities to speak their own language, and the reasonable expectation that all citizens can use the national language.

While Trump has often been disparaging about other European leaders, he's clearly an admirer of Viktor Orban who had openly supported Trump's campaign in 2016. And Trump showered him with praise at a White House meeting this year, commending Orban's hardline immigration policies and saying Hungary was a "very good member of NATO."

The two leaders bonded over their populist appeal. Trump told the press: "[He's] respected all over Europe. Probably like me, [he's] a little bit controversial but that's OK. He's a tough man but he's done the right thing on immigration."

Read alsoTrump viewed Ukraine as adversary, not ally, witnesses say – media

The Washington Post reported last month that both Putin and Orban had urged Trump to take a negative view of Ukraine. Just how much Ukraine was discussed at the White House meeting between Orban and Trump is unknown; it only lasted about an hour. But this much is clear: all three leaders have a negative view of Ukraine, if for differing reasons.

Additionally, Orban's unremitting campaign against liberal billionaire George Soros -- the target of anti-Semitic attacks by Orban's Fidesz party at the last election -- sits well with some Trump surrogates who also see Soros as a bogeyman in Ukraine.

Rudy Giuliani, Trump's personal lawyer, has claimed without evidence that Marie Yovanovitch, the ambassador to Ukraine who was recalled to Washington in May, had impeded his investigation in Ukraine, and has tied this baseless claim to a conspiracy theory involving funding from Soros. Russian officialdom has long cast Soros as a villain, claiming that his support for civil society in former communist countries is part of a U.S.-led plot to promote regime change.

Many foreign policy analysts have raised alarms about Trump's wholehearted endorsement of Orban, particularly given his relationship with Putin. Of greater particular concern is Orban's close relationship with Putin and Russia's International Investment Bank moving its headquarters to Budapest. Western intelligence sources have told CNN that Budapest has become a hub for Russian espionage in eastern Europe.

Hungary had also rejected a U.S. extradition request for two Russians wanted on weapons and drug trafficking charges, prompting the US State Department to say the decision "raises questions about Hungary's commitment to law enforcement cooperation."

None of which appears to have dimmed Orban's appeal to Trump.

One month before he met Trump at the White House in May, Orban gave a long interview to the Atlantic, in which he recognized Ukraine's geographical importance. "We must support Ukraine, since it is the main bulwark between us and the Russians," he said. "At the same time, we must not provoke Putin. And that is why I oppose the European Union's sanctions against him."