Armed Islamists have occupied the Algerian consulate in Mali with witnesses saying they have arrested staff and diplomats.

The group took down the Algerian flag and replaced it with their own black flag, witnesses told AFP news agency.

"I am in front of the Algerian consulate in Gao. Armed Islamists have entered the consulate, arrested the diplomats and staff and taken down the Algerian flag to put up their own," one witness told AFP.

"I can see men, armed, around the consulate and inside," said a second witness. "They have replaced the Algerian flag with a black flag with Arabic writing."

Gao, which houses the regional military headquarters, came under the control of Tuaregs and Islamists groups at the weekend.

Terrorised residents said several groups have taken control and rule over various parts of the city, raiding and looting homes.

Ansar Dire, a group linked to al-Qaeda in the Islamic Maghreb, has reportedly banned music and Western-style clothing in the city and has warned it will implement Sharia law.

The power vacuum was created after the central government was overthrown in a military coup. Mali is now ruled by a military junta.

The collapse of the government seems to have precipitated Tuareg advances. They have allied themselves with Islamists and taken control of several cities in the north of the country.

NGOs and aid workers in the region have been forced to stop their work, prompting concerns of a deepening humanitarian crisis in a drought-stricken area.