BAMAKO (Reuters) - Armed groups surrounded Timbuktu on Monday, the defense ministry said, preventing Malian interim authorities from being installed there under a peace pact meant to end years of lawlessness.

The return of state authority to the city was supposed to fill a vacuum that has turned northern Mali into a launch pad for jihadi attacks across the vast region bordering on the Sahara Desert.

Banks, schools and shops were shuttered and the city’s streets nearly deserted, barring patrols by U.N. peacekeepers, and residents reported sporadic gunfire that had petered out by the afternoon.

“Armed groups opposed to the interim authorities, which should have been put in place today, are positioned around the city and are threatening to take it over,” Defence Ministry spokesman Colonel Abdoulaye Sidibe said by telephone.

He said the arrival of the new authorities had been postponed and negotiations were under way.

A Reuters cameraman saw fighters standing on sandbags and wielding rocket launchers at an official checkpoint, their faces wrapped with turbans to protect them against the blowing sand.

Most government posts have been unfilled since ethnic Tuareg separatists and desert jihadists took over northern Mali in 2012, before French forces intervened to push them back. A peace deal signed in 2015 was meant to enable authorities to return.

But pro and anti-government Tuareg-dominated armed factions had been quarrelling for months over how the authorities should be constituted - until a breakthrough two weeks ago.

Last week, authorities were installed in the towns of Kidal - seen as the north’s most recalcitrant bastion of Tuareg separatism - and Menaka.

But there were also difficulties in Gao, the region’s most populous city where dozens of armed men briefly occupied the regional assembly until their demands for greater participation were met.

Sidibe said the main Tuareg faction involved in the resistance in Timbuktu was the Council for Justice in Azawad, as Tuaregs call their traditional homeland in Mali’s north.

However, witnesses said other groups were also involved and had divided up checkpoints surrounding the iconic desert city.

“Are we building any kind of sustainable peace through this kind of process that gives the most resources to the guys with guns?,” asked Jean-Herve Jezequel, deputy director of International Crisis Group’s West Africa project.

Once installed, the interim authorities are supposed to remain in place until regional elections. They are also meant to oversee disarmament and the return of fighters to barracks.

Despite continued French troop deployments, a U.N. peacekeeping mission and years of peace talks, Mali remains beset by banditry, unrest and Islamist attacks.

Underscoring the dangers, at least four members of security forces were killed a village in southwestern Niger near the Malian border, residents and a security source said. Militants also attacked a central Malian army post near the border with Burkina Faso on Sunday, killing 11 soldiers.