Demonstrators protesting against a new United Nations migration pact outside the European Union’s headquarters in Brussels this weekend were met with tear gas and water cannons after some of them became violent.

Riot police closed off streets in the city center and confronted some protesters after about 5,000 gathered on Sunday for a march local authorities initially banned due to the threat of violence.

The protesters were objecting to a UN compact on migration, a non-binding agreement among the majority states to cooperate in ensuring safe migration and upholding the rights of migrants around the world, Sky News reported. The pact, which was signed in Marrakesh last week, has been criticized by conservative and rightwing voices, who contend Europe is already overrun with migrants from Africa and the Middle East. The huge numbers that flooded the continent after the start of the war in Syria have been tied to a rise in crime and terrorism as well as labor and poverty issues.

Belgium’s high court overturned the initial ban on the march, citing the right to protest peacefully. Police in Brussels said some protesters became violent when they were asked to disperse from outside the EU building.

In Belgium, the government had to be revamped last week because the coalition party opposed Prime Minister Charles Michel’s decision to sign the pact.

The Associated Press contributed to this report.