Nigeria's electoral body has been told to allow Vice-President Atiku Abubakar to run for president in April's poll.
Atiku Abubakar denies allegations of corruption
The Federal High Court in Abuja ruled the electoral body lacked the power to exclude Mr Abubakar from the election.
But this contradicts a ruling made hours earlier by a superior court which said the Independent National Electoral Commission could disqualify candidates.
Mr Abubakar became a leading opposition candidate after falling out with former ally President Olusegun Obasanjo.
Justice Tijani Abubakar at the Federal High Court ordered Inec to respect the verdict and put Mr Abubakar's name on the 21 April ballot.
But earlier, the appeal court in Abuja ruled that Inec can bar candidates who are not qualified to stand for this month's elections.
The BBC's Senan Murray in the capital, Abuja, says that in theory the appeal court ruling will carry precedence as it is a higher court.
But Mr Abubakar's lawyer Rickey Tarfa says there is no confusion over the court rulings, pointing out that the high court specifically ordered Inec to include Mr Abubakar's name on the ballot.
"The high court is saying that Inec had no reason whatsoever to disqualify the vice-president," Mr Tarfa told the BBC News website.
"Besides, the ministerial panel report they say indicted him has been quashed by a court of competent jurisdiction."
The vice-president's spokesman dismissed claims that the appeal court ruling was a blow to Mr Abubakar's presidential hopes.
Mr Obasanjo is standing down after two terms in office
Mr Abubakar was indicted for graft by a government ministerial panel which investigated corruption in an oil fund. He denies corruption.
Electoral officials say corruption charges against him would have to be dropped for him to be eligible to run for presidency.
Mr Abubakar filed an appeal after Inec omitted his name from a list of 24 candidates cleared to stand for election.
The losing parties in both cases say they plan to appeal.
President Obasanjo is standing down after two terms and Umaru Yar'Adua is standing on behalf of his People's Democratic Party (PDP).
Mr Abubakar, a founding PDP member, defected to the opposition Action Congress (AC) after he fell out with President Obasanjo.
AC is one of the two main opposition parties contesting the election, and continues to hold mass rallies around the country, despite the block to its candidates' presidential ambitions.