Viktor Orban's tough approach to the migrant crisis has positioned him as one of Europe's most controversial leaders.
His comments describing the situation as "Germany's problem" and insisting that Hungarians have "the right not to live together with populous Muslim communities" drew strong criticism from EU politicians.
But the Hungarian prime minister has long riled many of his European colleagues with divisive domestic and foreign policies, including close ties with Russia.
Despite forging the country's strongest government since the fall of communism, his democratic and economic credentials have been questioned.
After a surge in the number of refugees entering Hungary he is reaching out to anti-immigrant opinion across Europe.
'Politics of the gutter'
As a young lawyer, Mr Orban attracted attention on 16 June 1989 by publicly demanding the withdrawal of Soviet forces and the holding of free elections.
According to the CV posted on the official prime ministerial website, he was already a founding member of the Federation of Young Democrats (Fidesz), which he would eventually make Hungary's party of government.
He was elected an MP in the 1990 vote that followed the country's transition to multi-party democracy.
Assuming the leadership of Fidesz in 1993, he moved the party to the right and in 1998 became prime minister at the head of a centre-right coalition.
That first Orban administration took Hungary into Nato and cut inflation while maintaining economic growth.
Hurt by corruption scandals and regarded by some as divisive, it fell after a single term and Mr Orban spent the next eight years in opposition.
- Born 31 May 1963 in the small Hungarian village of Alcsutdoboz
- Trained as a lawyer at university in Budapest and later studied the history of British liberal political philosophy at Oxford
- Founding member of Fidesz
- Twice prime minister: 1998-2002 and 2010-present
- Married with five children
- Football fan and player (FC Felcsut)
Out of government, Mr Orban was regarded by political analysts as a populist, to the extent that in 2007 the UK's Economist awarded him its "politics of the gutter award", citing his "cynical populism and mystifyingly authoritarian socialist-style policies".
But bickering on the left played into the hands of Mr Orban, and in 2010 Fidesz and its Christian Democrat allies were returned to power with an overall majority.
Mr Orban said his landslide victory represented the desire of Hungarians to "close the chapter of post-communism".
Some view him as a pragmatist; he himself insists he is providing strong, stable political leadership, with policies that reduce bureaucracy and empower individuals as responsible members of society.
He soon embarked on the constitutional and financial reforms that have so antagonised his opponents.
His supporters say he has introduced long-needed structural changes, such as restricting early retirement in the police and military and making the welfare system more transparent.
But critics accuse his government of imposing a conservative agenda on everything, from the media to the economy and religion.
In December 2011 parliament approved a controversial new election law that halved the number of MPs and redrew constituency boundaries. Opponents said it tilted the system in favour of Mr Orban's Fidesz party.
A month later tens of thousands of people took part in protests in Budapest against the measure, branding the prime minister a dictator - or "Viktator".
Another taunt shouted by the crowd was "bovli", or "junk" in Hungarian, mocking the downgrading of the country's credit rating under his premiership.
A central bank law was also passed on 30 December 2011 in defiance of EU and IMF warnings that it would infringe on the bank's independence.
The law would become a key stumbling block in negotiations over the country's massive bailout.
The European Commission - the EU's executive arm - went on to take legal action against the government over reforms to the central bank, data protection and the judiciary.
And in 2013 Hungary's constitutional court struck down the controversial electoral law, saying it restricted voter rights.
More protests have followed, with tens of thousands taking to the streets over corruption allegations and Mr Orban's relationship with Russia.
In 2014, the government approved a €10bn (£8.3bn) deal with Russia over the financing of two new reactors at the Paks nuclear power plant.
Mr Orban went on to criticise EU sanctions imposed on Russia over the Ukraine crisis.
But last December he suffered a serious setback when Russia cancelled its plans for the South Stream gas pipeline - a project which he had backed in defiance of the EU.
His popularity has waned in recent months, with his Fidesz party losing two seats in by-elections this year.
The result saw the far-right party Jobbik win its first ever individual constituency seat in parliament. following moves to woo centrist voters.
With Jobbik set to present a major challenge in Hungary's 2018 parliamentary elections, Mr Orban is keen to appear both powerful and patriotic.
His policy on migration - including the construction of a 175km (109-mile) fence along the border with Serbia - is his latest show of strength.