BAMAKO -United Nations peacekeepers took over security duties from African troops in Mali on Monday with a mission to ensure stability in the conflict-scarred nation just four weeks ahead of planned elections.

A 12,600-strong force officially replaced the AFISMA military mission, which has been supporting French soldiers who entered Mali in January to halt an Islamist advance and help the government re-establish its authority over the vast country.

Soldiers from nine troop-contributing west African countries and UN officials took part in a "re-hatting" ceremony in Bamako on Monday, replacing their head gear with the distinctive light blue berets of the UN.

France is winding down its deployment from its peak of nearly 4,500 but is to keep up to 1,000 troops in Mali and will maintain responsibility for military strikes against the Islamists.

Rwandan General Jean-Bosco Kazura, formerly second in command of African Union troops in Sudan's western Darfur region, will lead the UN mission -- known as MINUSMA.

"I want to thank AFISMA for all their work. Our mandate is to secure the major cities of the north, the protection of civilians... political mediation and the protection of the rights of men and women," said Bert Koenders, the UN Secretary General's representative in Mali and the head of MINUSMA. The force is made up largely of Africans already stationed in Mali but China has offered to supply more than 500 troops in what would be its biggest contribution to UN peacekeeping.

The mission is due to play a key role in presidential polls announced for July 28 but the election commission has raised doubts over its ability to stage a free and fair vote with such short notice.

The commission's president Mamadou Diamountani said last week it would be "extremely difficult" to get up to eight million voting cards to the electorate in a country where 500,000 people have been displaced by conflict.

He also highlighted the instability in the northeastern town of Kidal, which is occupied by Tuareg separatists and still has no army presence despite a ceasefire between the transitional government and the rebels.