PRAGUE (AP) - The prime minister of Hungary on Wednesday brought his anti-immigration views to the Czech Republic, where a fellow leader has made migration a major campaign topic before the country's general election next week.

Czech Prime Minister Andrej Babis and Hungary's Viktor Orban shared their views during a meeting in a northern Czech city. Orban called illegal migration a threat to the future of countries in Central Europe.

Orban said he expected “millions” of refugees from Afghanistan to try to reach the European Union as part of a new mass migration wave.

Babis, an admirer of Orban's hardline policies, said his government agreed this week to send 50 Czech police officers to help guard a fence built during Orban's tenure on Hungary's border with Serbia. The border also demarcates part of the European Union's external boundary.

Orban was set to join Babis later Wednesday at a rally of the Czech leader's centrist ANO (YES) movement, which is considered an election frontrunner.

Babis has campaigned on the migration issue even though the Czech Republic is not a leading destination for refugees and asylum-seekers.

“It's an issue to which we keep returning,” Babis said.

Migration is not the only topic on which the Czech and Hungarian governments, as well as their regional partners in Poland and Slovakia, often differ from the EU's mainstream.

Orban and Babis expressed strong disagreement Wednesday with the EU's plan to fight climate change.