Police have fired tear gas and water cannons on demonstrators who congregated around the European Unions’ headquarters in Brussels after marching against a new United Nations migration pact.

About 5500 people gathered on Sunday (local time) for the march that local authorities initially banned for fear of violence.

Belgium’s high court overturned the ban, citing the right to protest peacefully.

Some held aloft banners bearing slogans including “Our people first” and “We have had enough, close the borders.”

Police in Brussels said some protesters became violent when they were asked to disperse from outside the EU building.

Some protesters threw projectiles and firecrackers, an AFP journalist on the scene reported.

Many marchers were supporters of the Vlaams Belang party, which opposes last week’s signing of the UN accord in the Moroccan city of Marrakesh.

A counterdemonstration drew around 1,000 people to another Brussels district, according to police.

The agreement is designed to frame an effective international approach to migration — a deeply divisive issue across Europe and beyond.

More than 150 states last Monday approved the pact, a Global Compact for Safe, Orderly and Regular Migration.

But NGOs have voiced doubts about its implementation both on the ground and the high seas.

Pope Francis on Sunday voiced his support for the agreement and urged the international community to show “responsibility, solidarity and compassion” in dealing with migrants.

The pontiff stressed the pact was designed to secure “safe, ordered and regular migration.”

But its provisions are not legally binding and detractors warn it could encourage uncontrolled people flows.

In Belgium the issue has become a political hot potato.

Belgian Prime Minister Charles Michel was left leading a minority administration after the biggest party in his coalition — the Flemish nationalist N-VA, which held four ministries — quit over the accord.

Some marchers called for Michel to resign at Sunday’s rally and a number of opposition parties have called for a vote of confidence in the government.