A Nigerian court on Wednesday upheld President Muhammadu Buhari's election victory earlier this year, dismissing a request by opposition parties to overturn the result over claims of voting irregularities.
Buhari, 76, won a second term with 56 percent of the February poll, which was long delayed and marred by violence.
Former vice president Atiku Abubakar of the main opposition People's Democratic Party (PDP), who came in second with 41 percent, immediately called the result a "sham".
Opposition parties lodged a legal challenge against the result in March.
Abubakar, 72, said he had been cheated of the chance to lead Africa's most populous state after a conspiracy between the electoral commission INEC and Buhari's ruling All Progressives Congress (APC).
However on Wednesday the presidential election tribunal found there was no evidence of the opposition's claims.
"This petition is hereby dismissed in its entirety," judge Mohammed Garba said on Wednesday.
The ruling was widely expected, with Buhari's government taking office last month.
Buhari has insisted that the election was free and fair, claiming the vote was "another milestone in Nigeria's democratic development".
The PDP in a statement on Wednesday rejected the ruling and vowed to lodge an appeal at the country's highest court.
The party described the ruling as "provocative, barefaced subversion of justice and direct assault on the integrity of our nation’s justice system."
It appealed to its supporters to "remain calm and not to lose hope or surrender to despondency or self-help, as our lawyers are upbeat in obtaining justice at the supreme court."
EU and local observers spoke of "serious problems" in the February polls, which was hit by violence including 53 deaths.
Some reported vote-buying, intimidation and violence towards voters and officials, which have been a problem in previous elections in Nigeria.
Buhari in a statement on Wednesday welcomed the ruling, saying was "victory for Nigerians who trooped out to overwhelmingly elect him for a second term in office."
While commending the judiciary for "dispensing justice without fear or favour," the president urged his opponents to join him in the task of moving Nigeria forward.