The European Union and Canada signed a far-reaching trade agreement on Sunday that commits them to opening their markets to greater competition, after overcoming a last-minute political obstacle that reflected the growing skepticism toward globalization in much of the developed world.
Canada’s prime minister, Justin Trudeau, had been forced to call off an earlier trip to sign the deal after Wallonia, the French-speaking region of Belgium, used its veto to withhold Belgium’s approval of the deal. The pact required the support of all 28 European Union countries.
On Friday, Wallonia, which has been hit hard by deindustrialization and feared greater agricultural competition, withdrew its veto after concessions were made by the Belgian government, including promises to protect farmers. Hours later, the European Union announced that the deal was back on track.
Mr. Trudeau signed the pact on Sunday, joined by Donald Tusk, the president of the European Council, which represents the leaders of the member states; Prime Minister Robert Fico of Slovakia, which holds the rotating presidency of the body that runs the bloc’s ministerial meetings; and Jean-Claude Juncker, the president of the European Commission, the bloc’s executive arm.
But the Walloon intransigence has underlined the extent to which trade has become politically radioactive as citizens increasingly blame globalization for growing disparities in wealth and living standards. Across Europe and the United States, opposition to trade has become a rallying point for populist movements on the left and the right, threatening to upend the established political order.
A compromise among the regions of Belgium, which persuaded Wallonia to drop its veto, called for language to clarify the handling of trade complaints brought by Canadian or European companies.
Belgium pledged to refer the arbitration system to the Court of Justice of the European Union, where judges can assess its legality.
Nonetheless, several dozen anti-trade activists held a rowdy protest on Sunday outside the building where Mr. Trudeau signed the pact, the Comprehensive Economic and Trade Agreement. The protesters splashed red paint on the forecourt of the building and condemned a planned Transatlantic Trade and Investment Partnership between Europe and the United States.
That much larger deal, known as T.T.I.P., has already stalled amid opposition from large numbers of Europeans, including many Germans and Austrians. The protesters see the Canadian deal as a warm-up for a much larger battle.
The spectacle of tiny Wallonia with just 3.6 million people holding up a deal that affects more than 500 million Europeans and 35 million Canadians and prompting European Union leaders to delay a summit meeting has rattled Western leaders.
“In the end, people who favor free trade survived to fight another day,” said Jacob Funk Kirkegaard, a senior fellow at the Peterson Institute for International Economics in Washington.
“Now that we see the Canadian deal has made it over the finish line, the Atlantic trade deal still has a fighting chance,” he said. “But it won’t be easy. T.T.I.P. could similarly threaten traditional farming interests and arouse knee-jerk European suspicions about common trans-Atlantic health and environmental standards.”
As a legal matter, the member states’ legislatures still need to ratify the Canadian agreement. That could mean more hiccups before it goes into effect.
“The European Union is not yet in the group of hard protectionist and state-controlled economies like China or Russia,” said Hosuk Lee-Makiyama, the director of the European Center for International Political Economy, a research organization in Brussels. “Instead, the E.U. is carving out a new middle ground between those two countries and the United States.”
Europe, Mr. Lee-Makiyama said, is pivoting to a position as “neither an ally of East nor West.”
If the Obama administration has its way, the next major regional trade accord to make it over the finish line will be the Trans-Pacific Partnership, which includes the United States, Canada, Japan and Vietnam.
That deal is a more traditional trade accord aimed mainly at cutting tariffs and knocking down impediments to trade. But like the Europeans, many Americans do not want to make concessions that would lower wages or threaten jobs at home. The Asia-Pacific deal has become a hot issue in the United States presidential election; both major-party nominees, Hillary Clinton and Donald J. Trump, oppose it.
Mr. Funk Kirkegaard, the fellow at the Peterson Institute, said he gave the Pacific deal about a 30 percent chance of being concluded while President Obama still is in office. “Beyond January,” he said, “it’s all dependent on the results of the election and who’s the next president.”