BRUSSELS – The European Union and Canada signed a landmark trade pact on Sunday, ending days of drama after a small Belgian region refused to endorse the agreement and deeply embarrassed the EU.

The long-delayed Comprehensive and Economic Trade Agreement was bedeviled by yet another hold up overnight when Canadian Prime Minister Justin Trudeau’s plane had to return to Ottawa because of mechanical issues.

“What patience,” exclaimed European Commission President Jean-Claude Juncker as he embraced the arriving Trudeau at EU headquarters in Brussels.

In a brief exchange together in French, Trudeau said “difficult things are difficult, but we were able to succeed.” He declined to speak to reporters.

Trudeau and Juncker signed the pact with European Council President Donald Tusk and Slovak Prime Minister Robert Fico, whose country holds the EU’s rotating presidency.

On the other side of EU headquarters, a rowdy group of around 250 anti-CETA protesters gathered to block the front entrance as riot police watched. Red paint was smeared on the building. Some demonstrators had actually entered the foyer. Police took away 16 people, but did not break up the protest, spokeswoman Ilse Van de Keere said.

The EU needed unanimity among all its 28 members and Belgium needed the backing of all its regions to approve the pact. Trudeau had been due to sign CETA on Thursday, but was forced to cancel his flight when the country could not sign on because of opposition from the Wallonia region.

After several rounds of talks late into the night Belgium formally gave its endorsement on Saturday morning.

Smaller than the state of New Jersey, the Wallonia region blocked the deal between more than 500 million EU citizens and 35 million Canadians for several weeks. Politicians there argued the deal would undermine labor, environment and consumer standards and allow multinationals to crush local companies.

The EU says CETA will remove more than 99 percent of tariffs and boost trade with Canada by $13.2 billion a year, creating economic growth and jobs on both sides of the Atlantic. It insists the deal will not prevent governments from moving to protect environmental and social standards if they believe action is needed, despite concerns in Wallonia and elsewhere that big companies would have free rein.

“This is an important day for the EU and Canada too, because we setting international standards which will have to be followed by others with whom we are in negotiations as far as free trade is concerned,” Juncker told reporters Sunday.

Work on the agreement was launched in 2009 and the text was actually finalized two years ago but sat in limbo awaiting endorsement.

The delay has raised troubling questions about the EU’s ability to seal big trade agreements. Work on a similar pact with the United States dubbed TTIP has barely advanced this year and little progress is likely before a new U.S. president takes office in January.

“There is no realism in concluding TTIP right now,” EU Trade Commissioner Cecilia Malmstroem said Sunday, noting the U.S. election campaign.

None of it bodes well for the trade talks that Britain will need to have with its 27 EU partners once it leaves the bloc.