A Nigerian election tribunal rejected a bid by the main opposition candidate to overturn the result of February's presidential election, which saw Muhammadu Buhari returned to office.
Defeated contender Atiku Abubakar, a businessman and former vice president, was the candidate of the main opposition People's Democratic Party (PDP).
"This petition is hereby dismissed in its entirety," Justice Mohammed Lawal Garba said in announcing the ruling on Wednesday. All five judges who presided over the tribunal rejected Atiku's claims.
The defeat for Atiku was widely anticipated. Buhari, a 76-year-old former military ruler, was re-elected after first taking office as an elected leader in 2015.
The tribunal rejected all three of Atiku's claims: that the election was marred by irregularities, that he received more votes than Buhari, and the president did not have a secondary school certificate, a basic requirement to contest the election.
The PDP said it would mount an appeal against the ruling at the country's Supreme Court.
Buhari took 56 percent of the vote against 41 percent for Atiku, the electoral commission said in February, but with a turnout of just 35.6 percent compared with 44 percent in 2015.
Atiku rejected the result hours after Buhari was declared the victor and said he would mount a legal challenge.
"It is time for the country to move forward as one cohesive body, putting behind us all bickering and potential distractions over an election in which Nigerians spoke clearly and resoundingly," said Buhari in a statement on Wednesday following the tribunal's ruling.
The PDP said in a tweet it "completely rejects the judgment", which it described as a "direct assault on the integrity of our nation's justice system".
Every election result has been contested unsuccessfully since Nigeria returned to democracy in 1999, with the exception of the 2015 poll in which Goodluck Jonathan conceded defeat to Buhari.