Hungarian riot police roughly handle migrants at the border crossing with Serbia in Roszke, Hungary, on Sept. 16. (Marko Djurica/Reuters)

At the beginning of this year, Viktor Orban was adrift. His ruling Fidesz party had won three sets of elections in 2014 but had been badly hurt by political infighting, a scandal in financial brokerages and a controversial plan to tax Internet usage.

Hungary’s conservative prime minister needed an issue to galvanize support.

It arrived in the form of a flood of refugees and migrants seeking sanctuary in Western Europe from conflicts in the Middle East.

To get there, they had to pass through Hungary. And Orban said an emphatic no.

“There has been a big demand here for a strong leader, someone who puts things in order,” said Laszlo Csaba, professor of political economy at Central European University in Budapest. “Nine months ago, Orban was anything but. Now he is the strong guy who has taken control, a resolute leader. He’s become a player in Europe.”

This strongman approach was most clearly demonstrated in mid-September when Hungarian authorities responded violently to the wave of refugees and migrants trying to cross from Serbia, using tear gas and water cannons to repel them. Those actions led to widespread condemnation from other European countries and from international organizations such as the United Nations.

Although such scenes have ended — thanks to the fence Hungary built along its border with Serbia — the authorities continue to take a heavy-handed approach with the people who are being transferred from Croatia and then onward by Hungary to Austria.

The numbers have been staggering. Last weekend, 10,000 migrants and refugees came through Beremend, a sleepy border town that is the main thoroughfare for those being bused from the border zone to the train station.

“It’s quite astonishing that these people who are fleeing war and persecution are met as if they’re reentering a war zone,” said Lydia Gall of Human Rights Watch. “It’s a scary scenario.”

Soldiers, sometimes wielding assault weapons and with extra magazines slung across their bodies, greet refugees and migrants arriving at the Beremend border crossing with Croatia. Television images have shown soldiers with dogs at border crossings and armed military helicopters circling above.

This week, a Washington Post reporter watched as police officers with guns and batons formed a corridor at the Magyarboly train station to funnel the arrivals onto the train to Austria. One police officer shoved a man roughly down a carriage.

Hungarian Prime Minister Viktor Orban delivers a speech in Budapest, Hungary, on Sept. 7. (Bernadett Szabo/Reuters)

Such force is used even though most refugees are obedient at the border, following Hungarian police officers’ instructions to line up here, wait there. For the most part, they’re exhausted but also exhilarated to be moving rapidly westward.

Such displays of force have mainly been for Hungary’s benefit.

“The government didn’t spend its time or money on preparing for the refugee crisis. Instead, they spend their time and money exploiting the situation for domestic political purposes,” said Andras Biro-Nagy, head of research for Policy Solutions, a Budapest think tank.

“In terms of public support for the government, this strategy has paid off. Since last spring, the decline in popularity of the governing party has stopped, and it has even seen some improvement,” he said.

Polls show that most Hungarians back Orban’s approach. Support for the ruling Fidesz-KDNP coalition has risen five points in the past month to 34 percent, a level not seen for a year, according to the latest poll by the Nezopont Institute. Three-quarters of respondents supported the fence along the 110-mile Serbian border.

Since then, Hungary has finished a fence along the Croatian border and has put up an “experimental” razor-wire barrier along the Slovenian border.

In Beremend, residents support Orban’s response.

“He’s first-class,” said Gyorgy Gyuris, looking up from his job laying bricks into a paved sidewalk. “I’ve been following this situation closely because we are really affected by it. I really don’t understand why other countries have such a negative opinion of us.”

His co-worker, Karoly Ivsovics, agreed. “We all support the government here in Beremend,” he said. “We feel this crisis on our skin.”

Across the road at the pizzeria, the crisis has been good for business, not least because of all the journalists who have descended on the town in recent weeks. “We’ve got more people coming in here and eating and drinking these days,” said Barbi Hedli, a waitress, during a cigarette break outside.

Orban, 52, said his response was necessary.

“The crisis could destabilize Europe easily. It’s not difficult to imagine that one or two years from now, the old political elite will be replaced by the radicals,” Orban said in a recent interview with the Wall Street Journal.

He has drawn particular opprobrium for casting this as a religious issue, pitting Christian Europe against the mostly Muslim arrivals.

“Muslim culture is very strong. We don’t oppose it, but we haven’t had those parallel societies that are not integrated into European values,” Orban told the newspaper.

Hungary’s opposition parties offer little resistance. The far-right Jobbik party supports a strong stance against allowing in the migrants and refugees, while the fragmented left has mostly stayed quiet on an issue that for them is only a vote-loser.

For this reason, analysts expect the populist prime minister to continue his approach.

“Prime Minister Orban thinks that this subject is not only useful for him in terms of his domestic political agenda but also for reframing his negative image outside of Hungary,” Biro-Nagy said. “Outside Hungary, Orban’s image is of an authoritarian populist. But he thinks that this refugee crisis gives him a chance to appear as a defender of Christianity and the defender of Europe.”

Read more:

Most Syrian refugees are just too poor to flee to Europe

Some refugees in Germany get Zumba classes, but others sleep on the streets

A small town in Slovakia held a vote accepting refugees. 97 percent said no.