The U.N. rights office in Kampala will officially close on Saturday after the Ugandan government decided not to renew the Host Country Agreement, according to a U.N. statement.
Sub-offices in Gulu and Moroto have already closed in recent weeks, it added.
"I regret that our office in Uganda had to close after 18 years, during which we were able to work closely with civil society, people from various walks of life in Uganda, as well as engaging with State institutions for the promotion and protection of the human rights of all Ugandans," U.N. rights chief Volker Turk said in the statement.
He pointed out that since the office was first established in 2005, it has engaged on a range of rights issues, including on helping bring Uganda's domestic legislation into compliance with international human rights laws and standards.
"Much progress has been made in the country over the years, but serious human rights challenges remain in the path to full enjoyment of human rights for all," he said.
Turk expressed particular concern about the rights situation ahead of Uganda's 2026 elections, in light of the "increasingly hostile environment in which human rights defenders, civil society actors and journalists are operating."
He criticized the erosion of free expression, pointing to dozens of NGOs arbitrarily suspended two years ago, as well as an amended law on Computer Misuse.
The U.N. rights chief also slammed the recent passage of a "deeply discriminatory and harmful anti-homosexuality law, that is already having a negative impact on Ugandans."
As the U.N. rights office prepares to pull out, he said it was vital that the government ensure that the national human rights body can function effectively and independently.
"The Uganda Human Rights Commission, our long-standing partner in the protection and promotion of human rights in the country, is chronically under-funded and under-staffed, and reports of political interference in its mandate undermine its legitimacy, independence and impartiality," Turk warned.
He urged the government to provide the commission with the human, technical and financial resources it needs.
"On our part, the U.N. Human Rights Office remains committed to working on human rights in Uganda, in line with my global mandate," Turk said.
The Ugandan government did not immediately react.
Opposition leader Bobi Wine meanwhile said the move showed Uganda's veteran President Yoweri Museveni "does not want to be held accountable for his actions by anybody."
"With such an office closed, Ugandans are left at the mercy of a ruthless dictator," Wine, whose real name is Robert Kyagulanyi, told AFP.
Adrian Jjuuko, executive director of the Human Rights Awareness and Promotion Forum, told AFP that the closure "is not good for Uganda."
It "sets a dangerous precedent and the government should not have acted this way," he added.