Morocco is to pull out of a UN buffer zone in the disputed Western Sahara territory, an official statement says.
The country says the former Spanish colony is part of its territory, while the Polisario independence movement wants a vote on its self-determination.
Tension in the area flared up a year ago when Morocco moved into the buffer zone, breaching a UN-backed ceasefire.
Morocco recently rejoined the African Union, which it had left over the body's recognition of Western Sahara.
The decision to withdraw from the Guerguerat zone is said to have been taken in person by the Moroccan King Mohammed VI.
The move came after the sovereign spoke on the phone with the UN Secretary General Antonio Guterres who asked him to pull out his troops.
"The Kingdom of Morocco will proceed from today with a unilateral withdrawal from the (Guerguerat) zone," the Moroccan foreign ministry said in a statement.
Western Sahara is a sparsely-populated area of mostly desert situated on the north-west coast of Africa.
It was annexed by Morocco in 1975 - a move resisted by the Polisario Front.
A 16-year insurgency ended with a UN-brokered truce in 1991 and the promise of a referendum on independence.
But this has yet to take place and Morocco still controls two-thirds of the territory, while thousands of refugees live over the border in Algeria.
Morocco's decision to withdraw its troops does not signify a major change in the kingdom's policy - it will still work towards ensuring international recognition of its claim over Western Sahara.
The announcement does, however, indicate a willingness to work with the United Nations, and in particular the new Secretary General, Antonio Guterres.
Mr Guterres' predecessor, Ban Ki-moon, infuriated Rabat by describing Morocco's annexation of Western Sahara as an "occupation" - a remark he later apologised for.
Morocco is rolling out a renewed campaign on Western Sahara - including joining the African Union, and King Mohammed VI making several trips to African countries.
The military withdrawal is also presumably intended to signal a willingness to compromise.
But the Polisario Front and its supporters will want to know whether that extends to giving the Sahrawi people the referendum on their future which has been delayed for so many years.