Hungary's prime minister vented his anger against the influx of migrants on a visit to Russia on Wednesday, saying that it threatens the identity of EU nations and raises terror threats.

Viktor Orban made the comments during a visit to Russia, speaking a day before a European Union summit where the migrant crisis is expected to feature prominently on the agenda.

Orban said after talks with President Vladimir Putin that Hungary disagrees with those in the EU who see the flow of migrants as something good.

"Europe's largest nations now believe it's mostly positive," he said through an interpreter. "Our view is that it's bad."

Without naming Germany or any other EU member, Orban went on to assail those in the EU who see Hungary's desire to protect its ethnic and Christian roots as a "voice from the Dark Ages."

In remarks heralding fierce debates at the EU summit, Orban said that for Hungary "Christian and national values will be as important in the future as they were in the past," adding that his nation believes that "uncontrolled migration will cause more harm than good."

He went on to assail the EU mechanism requiring members to host migrants, saying that "no one can be forced to live with the people whom they don't want to live with."

Asked about his view, Putin said that he wouldn't weigh in on an EU domestic issue, but praised Orban for his stance.

"We sympathize with the stance of the Hungarian leadership, the prime minister of Hungary to defend the European identity, the identity of their country, their people" he said.

Putin added that defeating extremism and rebuilding the fractured Mideast states are essential for stemming the migrant flow.

The two leaders have developed close ties, and Hungary has pushed for the lifting of EU sanctions against Russia imposed over its actions in Ukraine.

The EU has made the prospect of lifting sanctions contingent on the fulfillment of a peace deal for eastern Ukraine, but Putin emphasized Wednesday that it's up to Ukraine to fulfill its end of the deal.