By Marton Dunai

BUDAPEST (Reuters) - Hungarian Prime Minister Viktor Orban on Tuesday said the migration and foreign policy plans of U.S. Republican Presidential candidate Donald Trump were "vital" for Hungary, whereas those of rival Democrat Hillary Clinton were "deadly".

The outspoken conservative leader Orban is the first European head of state to express a clear preference for either of the two candidates, who will face each other in elections in November 2016.

Orban has in the past upset fellow members of the European Union over policy, most recently with his tough stance on Europe's migrant crisis, objecting to EU resettlement plans and having a fence built along Hungary's southern border.

Orban said the U.S. Democrats supported migration as well as what he described as "democracy export", while Hungary - like Trump - opposed both, "making it clear where Hungary's interests lie."

"The Democrats' foreign policy is bad for Europe, and deadly for Hungary," he said. "The migration and foreign policy advocated by the Republican candidate, Mr Trump, is good for Europe and vital for Hungary."

Orban had on Saturday called Trump's security policies "valiant." His remarks came after Trump raised ire for telling the New York Times last week that he would tie any U.S. military help to NATO allies to conditions in the event of a Russian attack.

Clinton's campaign struggles to contain the political fallout from a leak of thousands of emails in a hacker attack that they said were designed to help Trump. Experts and U.S. officials say the attack came from Russia.

Both Moscow and the Trump campaign have said those claims were "absurd".

Orban's government has unnerved some partners with its close ties to Russia. It secured large business deals with Moscow, such as the construction of a big new nuclear power plant, and criticized the European Union's embargo on Russia.

"Hungary's foreign policy has borne an eerie resemblance to Russian diplomatic interests in recent years, and indeed has been little short of an extended arm of the Russian government in foreign policy matters," Political Capital analyst Peter Kreko said.

"I don't think Putin is behind the budding relationship between Trump and Orban but both are interested in improving Russian ties so theirs is an alliance of interests."

(Reporting by Marton Dunai; Editing by Hugh Lawson and Raissa Kasolowsky)