The head of the mission, Peter Graaff, met the Ghanaian president to thank the country for hosting the agency since it was set up in September last year.
A small team will stay until the end of June to co-ordinate air operations, the agency, known as Unmeer, said.
Ghana has not been affected by the epidemic in West Africa, which has killed more than 11,000 people.
Africa news: Tuesday 9 June as it happens
Why Ebola is so dangerous
Ebola basics: What you need to know
The BBC's Africa health correspondent Anne Soy says the mission set up its headquarters in Accra as it was far enough away from the affected countries, where there was logistical lockdown, but close enough the epicentre of the outbreak.
"By allowing us to set up our headquarter in Accra, President [John ] Mahama demonstrated extraordinary leadership and solidarity," Mr Graaff said in a statement.
"He made Ghana the only open gateway to Guinea, Liberia and Sierra Leone thus allowing the movement of thousands of Ebola responders and medical and essential supplies when they were most needed."
As a result, Unmeer said Guinea, Liberia and Sierra Leone now had the necessary response capabilities in place to efficiently test, treat and isolate Ebola patients.
11,164
Deaths - probable, confirmed and suspected
(Includes one in the US and six in Mali)
4,806 Liberia
3,912 Sierra Leone
2,431 Guinea
8 Nigeria
President Mahama said the downsizing of Unmeer was a sign of success for "short and sharp interventions".
Most of the mission's staff and assets have been moved to Sierra Leone and Guinea, where 24 new cases of Ebola were reported in the last week.
Last month, the World Health Organization (WHO) declared Liberia free of Ebola as the country had had no new cases in 42 days.
The basics: What you need to know
The UN's emergency Ebola response headquarters in Ghana's capital, Accra, is to close as the outbreak slows.