Ugandan President Yoweri Museveni has signed into law a bill that removes a presidential age limit from the constitution and allows him to run for election again.

Mr Museveni, one of Africa's longest-serving leaders and a US ally, is 73 and would have been ineligible to run in 2021.

Now he could rule until 2031.

Critics in the east African nation saw the bill as an attempt by the president to rule until his death.

The age limit had prevented anyone younger than 35 or older than 75 from holding the presidency.

Mr Museveni, who took power by force in 1986, is the latest in a number of African leaders who have tried to prolong their time in office by changing the constitution or other means.

At least 10 countries on the continent have seen term limits dropped, and "leaders in more than 20 countries effectively do not face restrictions on their time in power", according to the US-funded African Centre for Strategic Studies.

A coalition of more than 600 civil society organisations protested against the signing of the bill.

"This law will remain largely inconsequential because it was passed against the wishes of majority of Ugandans," said Crispy Kaheru, co-ordinator of the Citizens' Coalition for Electoral Democracy in Uganda.

He said the law will be challenged in court and "in the court of public opinion", adding: "In the end it is the majority of Ugandans who will have their last say on how they wish to be governed."

Mr Museveni once said he despised African leaders "who want to overstay in power", but now says he referred to those who ruled without being elected.

Uganda has not witnessed a peaceful transfer of power since independence from Britain in 1962.