Since the late 1980s Uganda has rebounded from the abyss of civil war and economic catastrophe to become relatively peaceful, stable and prosperous.
But the lives of hundreds of thousands of people in the north remain blighted by one of Africa's most brutal rebellions.
In the 1970s and 1980s Uganda was notorious for its human rights abuses, first during the military dictatorship of Idi Amin from 1971-79 and then after the return to power of Milton Obote, who had been ousted by Amin.
During this time up to half a million people were killed in state-sponsored violence.
Since becoming president in 1986 Yoweri Museveni has introduced democratic reforms at a steady pace and been credited with substantially improving human rights, notably by reducing abuses by the army and the police.
At a glance
- Politics: Multi-party politics restored in 2005
- Security: Terror of Lord's Resistance Army (LRA) over two decades has spread to neighbouring countries. Allied Democratic Forces, a rebel group trying to set up an Islamic state in Uganda, is active in DR Congo
- Economy: Uganda is vulnerable to changes in the world price of coffee, its main export earner. Oil discoveries have boosted prospects
- International: Uganda has been actively involved in the DR Congo conflict. LRA leaders are wanted by the International Criminal Court for war crimes
Country profiles compiled by BBC Monitoring
Western-backed economic reforms produced solid growth and falls in inflation in the 1990s, and the discovery of oil and gas in the west of the country boosted confidence.
The global economic turndown of 2008 hit Uganda hard, given its continuing dependence on coffee exports, and pushed up food prices.
This galvanised the opposition, which disputed Mr Museveni's victory in the 2011 presidential elections and went to to organise street protests about the cost of living and political freedoms.
The president has also come under fire for Uganda's military involvement, along with five other countries, in neighbouring DR Congo's 1998-2003 civil war.
DR Congo accuses Uganda of maintaining its influence in the mineral-rich east of the country. Uganda says DR Congo has failed to disarm Ugandan rebels on its soil.
The cult-like Lord's Resistance Army (LRA) has rampaged across northern Uganda for the past two decades and has in recent years spread to neighbouring countries, abducting and killng tens of thousands as well as displacing more than 1.5 million.
Its leader Joseph Kony says he wants to run the country along the lines of the biblical Ten Commandments, and is wanted by the International Criminal Court for crimes against humanity.
Some critics have wondered why the conflict has gone on for so long and questioned Mr Museveni's commitment to ending the insurgency. The government in turn has pointed to progress since 2011, when the US committed itself to tracking down LRA bases in nearby countries.
Uganda has won praise for its vigorous campaign against HIV/Aids. This has helped to reduce the prevalence of the virus - which reached 30% of the population in the 1990s - to single-digit figures.