Abubakar was excluded from a list of approved candidates released in March by the Independent National Electoral Commission, but the court ruled the commission did not have the power to disqualify candidates.
The electoral body said it excluded the candidates because of accusations of corruption or fraud. Abubakar was accused of fraud after falling out of favor with President Olusegun Obasanjo last year and defecting from the ruling People’s Democratic Party.
Two previous conflicting lower court rulings on the matter heightened confusion over whether Abubakar would be on the ballot on April 21.
Monday’s unanimous judgment applied to Abubakar and at least six disqualified governorship candidates. Nigeria’s state elections were held over the weekend, so those candidates could challenge the legality of the elections.
“Governorship elections where any candidates were disqualified by INEC are null and void,” Lai Mohammed, spokesman for Abubakar’s Action Congress party, told Reuters.
Nigerian and European observers called for improvements in polling practices for the presidential election after reporting flaws with the state elections.
Authorities reported that fights between supporters of rival parties and other violence surrounding the polls left about 50 people dead over the weekend.
The results released on Monday showed the PDP winning 26 of 32 states, and were met by protests of opposition party members and supporters.
Saturday’s election will determine who will take over for Obasanjo, who has reached the constitutional term limit, and will mark the first turnover of power from one elected leader to the next.
PDP candidate Umaru Yar’Adua is considered the favorite to win the election. While Abubakar’s participation was up in the air, All Nigeria People’s Party candidate Muhammadu Buhari was considered the biggest challenger. The opposition parities are set to discuss a potential coalition this week.