The UN Security Council has unanimously approved a resolution to create a UN peacekeeping force for Mali.
The 12,600-strong force is intended incorporate some 6,000 West African soldiers already in the country.
The resolution was proposed by France, which intervened militarily in January to drive out Islamist militants from Mali's northern desert region.
The UN force is to deploy at the beginning of July before planned nationwide elections.
The BBC's Alex Duval Smith in Mali's capital, Bamako, says the UN force will stretch the definition of peacekeeping to new limits, as there is no peace agreement for it to enforce in Mali.
On a visit to Bamako, Jeffrey Feltman, a UN under-secretary-general in the department of political affairs, said the resolution had been hotly debated.
Islamist groups took advantage of a coup in March 2012 to extend their control across northern Mali, where they imposed a strict form of Islamic law.
Northern towns have been recaptured in the French-led operation but some fighters remain in desert hideouts.
France began withdrawing some of its 4,000 troops earlier this month - but has been pushing for a UN force to take over from the West African force, Afisma.
Chad, whose desert-trained troops are seen as the most effective of the African forces, has also started to pull its troops out of Mali, saying its mission has been accomplished, although they may join the UN force.
Mali crisis timeline
- October 2011: Ethnic Tuaregs launch new rebellion after returning with weapons from Libya, where they had fought for Gaddafi
- March 2012: Military officers depose President Amadou Toumani Toure over handling of rebellion
- April 2012: Tuareg and Islamist fighters seize control of northern Mali, declare independence
- June 2012: Islamist groups capture towns of Timbuktu, Kidal and Gao from Tuaregs, start to destroy Muslim shrines that offend their puritan views
- January 2013: Islamist fighters advance south, raising fears they could march on capital. Interim President Dioncounda Traore asks France for help. France intervenes, along with neighbouring countries. Northern towns recaptured
- April 2013: France and Chad begin to withdraw
- July 2013: Planned deployment of a UN peace force to incorporate the West African force on the ground. Nationwide elections due
The UN force - known by its French acronym Minusma - is to be made up of 11,200 military personnel and 1,440 police officers, making it the third largest, after those in Democratic Republic of Congo and Darfur.
UN officials say it will cost $800m (£520m) a year, according to the Reuters news agency.
Its mission is to stabilise "the key population centres, especially in the north of Mali.... to deter threats, initiate and actively... take active effective... steps to prevent the return of armed elements to those areas".
A French force of 1,000 soldiers will remain, in case they are needed to battle the al-Qaeda-linked groups.
Our reporter says there are fears that many insurgents have simply gone to ground since the start of the French intervention and they could resurface and target the UN mission.
The UN mission will be an expansion of a joint West African force already in Mali, which has come in for criticism and there are concerns over its capabilities, our reporter says.
Earlier this month US Pentagon official Michael Sheehan described Afisma as a "completely incapable force".
But West African force commander Major General Shehu Adbulkadir is confident that his soldiers will be up to the job.
"The success of this operation is hinged on: One, communication; two, intelligence; three, mobility; four, firepower," he said.
"So once the mandate and the rules of engagement will allow for these four, I don't think the challenge is insurmountable."
France decided to intervene in Mali after saying the al-Qaeda-linked militants threatened to march on Bamako.