UGANDAN President Yoweri Museveni has replaced his prime minister, removing a former ally some analysts had seen as a potential contender for the top job.

Amama Mbabazi, a lawyer, had enjoyed a close relationship with Uganda's veteran leader but ties between the two became strained recently, with Mr Museveni accusing Mr Mbabazi of taking decisions in the ruling party without consulting him.

Mr Museveni named health minister Ruhakana Rugunda as Mr Mbabazi's replacement as prime minister, appointing one of his longest-serving ministers who is viewed as a loyal supporter of the president.

Mr Mbabazi had not said if he wanted to run in the 2016 presidential race, when Mr Museveni is widely expected to seek to extend his 28-year rule. The president, one of Africa's longest serving leaders, has also not stated his intentions.

But a power struggle had emerged in recent years between Mr Museveni and Mr Mbabazi, who also holds the post of secretary-general of the ruling National Resistance Movement. He was widely viewed as a "king-maker" in Mr Museveni's administration.

Nicholas Opio, a human rights lawyer and analyst, said: "He is testing Mbabazi. Will he remain loyal and accept a humble position of a mere secretary-general or is he now going to openly declare his presidential ambitions?"