Polish Prime Minister Mateusz Morawiecki, making his first bilateral visit since assuming office in December, and his Hungarian counterpart, Viktor Orban, pointed to Austria, where conservative and nationalist parties formed a coalition government last month.
"Democracy has been restored in Austria because the Austrians who reject immigration elected a government that also does not want immigration," Orban said. "This will be the case everywhere in Europe and I believe it is only a matter of time."
Morawiecki said the immigration issue, which he called a matter of national sovereignty, was "getting even hotter" in the EU "and it seems that it is going in our direction."
The two leaders again rejected EU efforts to resettle refugees among members of the bloc, while emphasizing their contributions to rebuilding efforts in the Middle East aimed at keeping more people at home.
"The EU's immigration policy is not working. What is more, it is not only not working but it has failed spectacularly," Orban said. "It is clear that the European people don't want immigration, while several European leaders are still forcing the failed immigration policy."
Poland is facing possible sanctions from the EU because of its perceived erosion of democratic principles, including recent steps increasing political control of the judiciary. While Orban has vowed to block any punitive measures against Poland by the EU, neither leader mentioned the issue during their news conference.
Later Wednesday, Orban said on Poland's state TV that Hungary "stands by Poland" in the conflict, arguing that the EU procedure it has "no real grounds." He added Poland and Hungary are economically strong, proud nations that will not take dictation from anyone.
"The way Poland is treated now may in the future be applied to other nations," Orban told TVP1.
Orban's domestic policies have also drawn strong EU criticism.
In their news conference, Morawiecki and Orban also emphasized the growing economic status of Central Europe and the Visegrad Group that also includes Slovakia and the Czech Republic.
Orban said Germany's trade with the four countries is now larger than its trade with France.
"Economically, this is at least as important for Europe as German-French cooperation," he said.
Associated Press writer Monika Scislowska in Warsaw, Poland contributed.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.