Mali has told the UN that its 12,000 peacemakers need to leave, after 10 years countering Islamist militants in the country.
Last year, France withdrew its forces after military leaders seized control of Mali and brought in mercenaries from Russia's Wagner group.
Why did the UN send a peacekeeping force to Mali?
In 2013, the UN launched a mission after separatist rebels and Islamist fighters banded together and occupied northern Mali. They hoped to create a separate state.
The UN peacekeepers arrived after 5,000 French troops, who were sent to try and put down the uprising.
The threat from Islamist militants, who have killed several thousand people and forced tens of thousands from their homes, has continued over the years.
While the UN force in Mali has a wider brief to protect civilians and contain the jihadist threat, it is not intended to go on the offensive against militants.
In Mali and across the wider region attacks have been carried out by Islamic State in the Greater Sahara and an al-Qaeda affiliate called Jamaat Nusrat al-Islam wal-Muslimin.
Another jihadist group, Ansaroul Islam, is active in Burkina Faso, and Boko Haram is active in countries around Lake Chad.
Has the UN mission been successful?
Despite the presence of UN peacekeepers and French troops, who led counter-terror operations, the number of terror attacks in Mali steadily increased, as did the number of Malians joining insurgent groups.
Over the past decade, more than 300 UN peacekeepers have been killed. It has been described as the deadliest peacekeeping mission in the world.
Russia and China has criticised the mission at the UN, and countries such as the UK and Sweden have refused to provide troops.
Last year, French President Emmanuel Macron said he would withdraw French forces.
He was angry that military leaders - who seized power in 2021 - delayed plans to hold democratic elections. They also invited the Russian mercenary group Wagner to provide an estimated 1,000 fighters to provide security.
At the moment it is unclear whether the recent mutiny by Wagner fighters in Russia will have a bearing on its operations in Mali.
Why does Mali want the UN peacekeepers to leave?
The UN's mandate in Mali is due to expire on 30 June.
The UN's Secretary General, António Guterres, had recommended extending their stay in Mali for another year.
However, Mali's Foreign Minister, Abdoulaye Diop, rejected this, saying the UN force had failed to respond effectively to security challenges.
UN commanders have complained that the Malian government has often interfered with their operations.
Mr Diop also accused the UN mission of "making serious allegations which are detrimental to peace, reconciliation and natural cohesion in Mali".
In May, the UN released a report alleging that during an anti-jihadist operation in central Mali in March 2022, Malian army troops and foreign mercenaries killed 500 civilians.
On Friday, the United Nations Security Council voted to withdraw the peacekeepers over the next six months.