President Yoweri Museveni, who is seeking re-election in Uganda on Thursday, took power as the head of a bush army in 1986 and has ruled ever since, making him one of the world's longest-serving leaders.
Rebel to Ruler
As a young rebel leader, Museveni helped topple dictator Idi Amin in 1979 before retreating to the bush to wage a guerrilla war against his repressive successor, Milton Obote.
Shortly after ousting the government and taking power in 1986, Museveni declares: "The problem of Africa in general, and Uganda in particular, is not the people, but leaders who want to overstay in power."
Museveni received early praise for returning some stability and prosperity to Uganda, which after years of coups, violent tyrants and civil war was among the world's poorest countries.
He was returned to office in 1996 in the country's first direct presidential election since independence from Britain in 1962.
Darling of the West
Uganda's economy grew rapidly in the 1990s as Museveni undertook sweeping reforms, pleasing foreign donors and financial lenders keen to sponsor a burgeoning African success story.
Museveni's early successes combating the HIV/Aids epidemic and reducing poverty burnished this image in the West as a modern African leader committed to good governance.
But his moral standing took a particular hit when Uganda and Rwanda invaded the Democratic Republic of Congo (DRC) twice in the late 1990s. Both armies were later charged in The Hague with looting Congo's resources, killing and torturing civilians and using child soldiers.
Museveni would also be accused of supporting rebels in the region — an allegation that would resurface time and time again during his long tenure.
In 2001, Museveni defeated his main opposition rival Kizza Besigye at the ballot box, and committed to standing down at the next election.
But instead, he changed the constitution in 2005 to do away with presidential term limits.
The following year — his 20th in power — he defeated a popular Besigye again in a vote marred by violence and irregularities.
That same year, the Lord's Resistance Army was largely driven out of northern Uganda after a grinding and brutal 20-year insurgency — although Ugandan troops hunted the rebel leadership in Sudan, DRC and Central African Republic for another decade.
Museveni pleased Washington — a close friend which provided Uganda billions in foreign aid — by sending troops to serve under the US in Iraq and to Somalia, where they formed the backbone of an African Union mission to confront the Al-Qaeda linked jihadists Al-Shabaab.
Drift toward autocracy
In 2010 the UN accused Ugandan troops of war crimes in eastern Congo. Kampala threatened to withdraw its peacekeepers from Somalia, South Sudan, Darfur, Ivory Coast and East Timor — a trump card it would use again in future when accused of further meddling in DRC.
Museveni won a fourth term in 2011 over Besigye, who again decried the vote as a sham. Not long after, security forces were deployed to violently suppress major street protests as food and fuel prices soared and the economy teetered.
Ugandan troops fought alongside South Sudan's forces as the new country descended into civil war in 2013. At home, the crackdown on critics intensified, with radio stations being taken off air and newspapers raided for airing suggestions that Museveni was grooming his son for succession.
In 2014, Museveni signed a controversial anti-homosexual bill into law, drawing resounding criticism from around the globe, and attracting US sanctions and a freeze on EU donor funds.
President for life
"I am not power-hungry, but mission-hungry" Museveni said in 2015, describing the economic transformation of Uganda as his only purpose, and vowing to return to cattle-keeping should he lose the election the following year.
But he won that, too, and proceeded in 2017 to change the constitution once more. This time he removed age limits for presidential candidates, clearing his path to run for a sixth term in 2021, aged 76, and reinforcing fears he plans to rule for life.
However, the veteran leader faces an energised campaign by a young opposition upstart called Bobi Wine, a musician-turned-MP who openly calls Museveni a dictator, and blames the endemic corruption under his rule for contributing to Uganda's high youth unemployment and bleak economic outlook.
Museveni, whose increasingly violent reprisals against Wine have drawn global condemnation, has accused outsiders and "homosexuals" of backing the neophyte opposition leader, and is expected to win the January 14 vote that observers say will be neither free nor fair.