Nationalist Prime Minister Viktor Orban told a huge rally in Budapest on Thursday that in elections next month Hungarians must fight "external forces and international powers" who want mass immigration into their country.
Seeking a third consecutive term and campaigning on an anti-immigration agenda, Orban said the April 8 vote was the "greatest battle" faced so far by the tens of thousands of his supporters waving national flags in front of parliament.
"External forces and international powers want to force all this (immigration) on us ... with the help of their henchmen here in Hungary, and they see the coming election as a good opportunity for this."
Many of the million irregular migrants from the Middle East, Asia and Africa who trekked across southeast Europe in 2015 passed through Hungary. It has responded with a border fence and strong opposition to EU proposals to settle migrants in member status under a quota system.
"Those who do not stop immigration at their borders will be lost," Orban said.
"They (external powers) want to take our country ... they want to force us to give it up voluntarily over a few decades to strangers arriving from other continents who do not ... respect our culture, our laws and our way of life."
Orban's supporters were joined by thousands of supporters of Poland's ruling conservative PiS party - another administration at odds with Brussels over migration and over Warsaw's efforts to tighten controls over courts and media.
Orban said Hungary and Poland were like two ancient trees with entangled roots.
"If Poland is strong, Hungary cannot be lost either," he said adding that the rally was also a demonstration of support for Poland.
He said Hungary had been joined by Poland, Slovakia, the Czech Republic, the United States, Austria and Italy in
opposition to immigration.
Orban said Hungarian opposition parties were backed by a network which included media financed by foreign companies, domestic oligarchs and NGOs funded by international speculators.
Supporters of Orban's Fidesz party carried banners with the slogans "Hungary protects Europe" and "We are with you Viktor".
Organisers brought people into the capital from the countryside in fleets of buses for the rally and march, which
coincided with a national holiday commemorating Hungary's 1848 revolution.
Orban's party suffered an unexpected setback in a recent municipal by-election, but remains well ahead of its rivals in opinion polls despite media reports that revealed the luxurious lifestyles of some Fidesz politicians and a murky investment deal involving one this week.
Opposition parties also held rallies in Budapest during the day.
Jobbik, a former far-right party which now positions itself more towards the centre, is the strongest opposition party and bitterly critical of Orban.
"Our freedom is under threat from oppression by a man obsessed with power ... as if we were sliding back into
communism step by step," its leader Gabor Vona told a crowd of 1,500 people.
Vona said his party would strengthen border security forces, reinstate "real democracy" with independent institutions and try to stop the emigration of Hungarians to work in richer western Europe.