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

As protesters gathered outside EU headquarters in Brussels, Canadian Prime Minister Justin Trudeau, European Council President Donald Tusk, European Commission President Jean-Claude Juncker and Slovak Prime Minister Robert Fico, whose country holds the EU’s rotating presidency, put an end to the suspense by signing the Comprehensive Economic and Trade agreement.

“This accord is the product of long discussions. Frank discussions, but which have always taken place in respect, among partners that share common values,” Trudeau told reporters afterward.

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

Smaller than New Jersey, Wallonia defied hopes for a deal between more than 500 million EU citizens and 35 million Canadians for weeks. Politicians there argued that CETA would undermine labor, environment and consumer standards and allow multinationals to crush local companies.