A still image taken from video shows the damage inside African military taskforce, G5 Sahel headquarters, in the town of Sevare, Mali. Picture: Le Sahelien/Handout via Reuters TV

Bamako - Five people were killed in an attack targeting the headquarters of the G5 Sahel regional anti-terrorism force in Mali on Friday, army sources said.

Two Malian soldiers and three attackers were killed in the battle, the governor of the Mopti region, General Alassane Sidi Toure told Radio Nationale.

Another four soldiers were injured and four attackers were arrested, with the three of them also being treated in hospital.

By attacking the G5 Sahel force, "a symbol of the battle against terrorism," the perpetrators had wanted to send a message, the governor said. "But it won't diminish in the slightest our determination in the fight against terrorism," he said.

The attack took place between 1 and 1:30 pm (1300-1330 GMT) at the organization's general headquarters in Mali's Sevare city, Diaran Kone, a spokesman for the Malian army said.

The G5 Sahel cross-border joint military force is made up of Burkina Faso, Mauritania, Niger, Mali and Chad and was launched in 2017. Its mandate is to combat terrorism in the region and it comprises 5,000 troops.

A damaged military vehicle inside African military taskforce, G5 Sahel headquarters, in the town of Sevare. Picture: Le Sahelien/Handout via Reuters TV

Kone said the headquarters had been "almost 60 per cent destroyed" in the attack.

"Loud explosions followed by shooting were heard from the camp," said Malamine Sidi Maiga, a local resident.

He added that the firing had since ceased and there were helicopters flying overhead.

Mali has been unstable for years, ever since an extremist uprising in the north in 2012 put much of the country into the hands of Islamist and other rebel groups.

The wreckage of a vehicle inside African military taskforce, G5 Sahel headquarters, in the town of Sevare. Picture: Le Sahelien/Handout via Reuters TV

A French military intervention in January 2013 turned back a jihadist and separatist insurgency in Mali's north, but various Islamist groups still stage attacks.

France last year pledged more than 8 million euros (9.3 million dollars) towards the G5 force and the EU gave 50 million.

The force was approved by the UN Security Council and operates alongside the Barkhane, a 4 000-strong French anti-terrorism force in the region, and MINUSMA, the UN's mission in Mali.

Around 1 000 German troops are also stationed in Mali as part of MINUSMA.