KAMPALA, Uganda (AP) — Uganda’s top court has upheld a law that removed an age limit for the presidency and cleared the way for President Yoweri Museveni to extend his long rule.

In a majority decision on Thursday, a panel of Supreme Court judges rejected a legal challenge to the constitutional amendment that jettisoned a clause preventing anyone 75 and over from holding the presidency.

Museveni, who is 74 and backed the amendment, would have been ineligible to run again when his current term expires in 2021.

Many Ugandans opposed the change, which was widely seen as handing Museveni a life presidency. Opposition lawmakers unsuccessfully tried to filibuster proceedings before the age limit was removed in 2017.

Museveni, a key United States ally on regional security, took power by force in 1986.