The mass demonstrations that rocked two European capitals Sunday told a continental story — an illustrative arc that begins with populist ire and anti-migrant sentiment and ends with disillusionment with an increasingly authoritarian status quo.

In Brussels, 5,000 right-wing demonstrators opposed the government’s decision to sign a U.N.-brokered migration pact. There were scenes of violence: Police used water cannons and tear gas to disperse protesters who were throwing rocks and paving stones, including a group that attempted to storm the offices of the European Commission. Nearly 100 were arrested.

In Budapest, an estimated 15,000 braved bracing cold to protest new laws enacted by the illiberal government of Hungarian Prime Minister Viktor Orban. One was the creation of a parallel court that effectively gives the executive control over the country’s judiciary. The other was a bill that allows employers to demand up to 400 hours in overtime from their employees each year to boost productivity. Critics dub it the “slave law.” Protests continued in the Hungarian capital on Monday.

In one instance, you see the nationalist rage that has come to tinge so much of European politics. In the other, you see the gathering disquiet over a deeply nationalist government — one that has used populist rhetoric to justify policies that have steadily undermined Hungarian democracy.

In the West, right-wing discontent has received a great deal of attention in recent years. But the latter may reflect a truer political battle brewing on the continent.

The unrest in Belgium began after Prime Minister Charles Michel, who led a center-right ruling coalition, traveled to the Moroccan city of Marrakech to sign the U.N.’s migration compact alongside more than 150 other countries. The pact is an innocuous document aimed at encouraging greater international cooperation on migration.

It’s not a formal treaty, and it’s wholly nonbinding. The United Nations is not about to impose migration policies on countries around the world. Yet that is precisely how anti-immigrant parties in Europe — not to mention the White House — have tried to frame the measure. The Trump administration signaled earlier in the year that it had no interest in joining the compact; a number of other European governments, including Hungary and the populist coalition in Italy, followed suit.

In Belgium, a right-wing Flemish party in Michel’s fragile coalition quit the government last week. Michel will probably limp along in a minority until elections next year. Analysts suggest that the decision by Michel’s partners to quit was a cynical calculation, a bid to gin up support for the far right ahead of a new vote.

It may prove effective. On Saturday, French far-right leader Marine Le Pen joined erstwhile Trump whisperer Steve Bannon — who is trying to marshal support for the continent’s nationalists ahead of next year’s European elections — at an event in Brussels hosted by Vlaams Belang, an ultranationalist Flemish party. “The country that signs the pact obviously signs a pact with the devil,” Le Pen said.

But if the scenes in Brussels showed the potency of anti-migrant feeling in corners of Europe, what’s happening in Budapest reinforces the sense that most Europeans have more pressing problems on their mind.

No European leader has seized anti-immigrant fervor as vociferously as Hungary’s Orban, a man hailed by Bannon and his counterparts in the European far right. Orban has been prime minister for nearly a decade and is seen as the head of the pack of ascendant nationalists in Eastern and Central Europe. As my colleague Griff Witte wrote in an extensive exposé, he has steadily tightened his grip on the levers of power, ushering in what critics describe as a creeping authoritarianism. All the while, he has waged a virulent culture war, demonizing migrants and lambasting Europe’s liberals.

“Supposedly independent institutions — including courts and prosecutors’ offices — have become instruments of political control,” Witte wrote. “Newspapers and television stations are bought up by friendly business executives and dutifully preach the government’s line. Elections still take place, but they are used as justification for the majority to impose its will rather than a chance for the minority to have its say.”

The mounting anti-government protests over the past week are a sign that the frustrated, embittered opposition can still puncture Orban’s nationalist balloon. On Sunday, working-class protesters expressed their economic anxiety with a majoritarian government that is believed by critics to be nurturing a kleptocracy.

“We feel it is the last chance to stop the dictatorship,” Marton Bartha, 28, a protester outside the state media headquarters on Sunday night, told the New York Times. “Maybe dictatorship is a strong word. But our freedom is being shrunk.”

Of course, Orban’s government tried to brush off the protests, labeling the protesters as stooges from “the pro-immigration Soros network,” a reference to the Jewish-American financier George Soros, whom Orban has made into a convenient scapegoat for his demagoguery.

But they may not be able to casually dismiss the opposition forever. “How long will this go on for, we really don’t know,” Peter Kreko, a political analyst in Budapest, told the New York Times about the protests. “But it’s a significant mass — in the sense that it seems there is a committed opposition against the government, and I do think it can be the starting point of a broader movement.”

It’s unclear what happens next. Next year’s European election will be seen as a litmus test for a whole host of issues — from immigration to satisfaction with a supranational project like the European Union to public concerns over the erosion of the rule of law. Orban and the West’s right-wing populists view the E.U. and the U.N. as remote citadels of unelected bureaucrats, bent on undermining the sovereignty of nation-states.

But we may be seeing the limits of what such populist hectoring can achieve politically. For Orban, a prime minister convinced that migration is a problem, the irony is that it actually could be part of a solution for his country. The Hungarian labor reform that has sparked such fury is a reaction to a larger demographic crisis: Hungary’s workforce, hit by emigration to wealthier nations in Europe, is stagnating and too small. There’s an obvious remedy to that, but it probably won’t be taken by the anti-migrant demagogue in power.