The Nigerian federal high court in Lagos has barred the military from deploying around polling stations during March 28 national elections, the lawyer for the parliamentarian who brought the case said on Tuesday.
Opposition leader Femi Gbajabiamila argued a deployment would violate the constitution, lawyer Ijeoma Njemanze said, amid opposition fears that soldiers may intimidate voters or tamper with ballot boxes.
The ruling, made on Monday by Justice Ibrahim Buba, does not affect troops already dispatched to northeast Nigeria, where Islamists have waged a six-year insurgency, she added.
The tight election pits President Goodluck Jonathan against former military ruler Muhammadu Buhari for the leadership of Africa's biggest economy and leading energy producer.
It was meant to happen on February 14, but was delayed by six weeks after the military said it could not guarantee security.
Jonathan is seeking a second elected term, in the closest-fought election since the end of military rule in 1999.
If the military deploys despite the court order, the opposition is likely to use that fact to dispute the result should it lose the parliamentary and presidential ballot, potentially spurring violence by Buhari's supporters.
Government spokesman Mike Omeri said "nobody is using the military to conduct elections. They are deployed to support the security services (and) sometimes convey electoral materials."
How Nigeria conducts this election will be closely watched by investors and foreign powers. Past polls have been marred by ballot box stuffing, intimidation and sometimes made up results, although the 2011 one was deemed the fairest yet.
Neither a defence nor a government spokesman immediately responded to a request for comment.
SECURITY FORCES' INVOLVEMENT
The military's role in the electoral process, including pressing for the vote to be delayed, has alarmed some Nigerians, reminding them of the days of dictatorship, which included annulment of a 1993 vote by a military government.
The case was brought after an outcry over the heavy deployment of troops in southwestern Ekiti and Osun states last year. Reports in the press alleged that soldiers had conspired to intimidate voters and rig a by-election in Ekiti - a charge the military and ruling party declined to deny or confirm but which Jonathan later described in an interview as "spurious".
Police on Tuesday banned all vehicle movements on the day of the election and the governorship poll two weeks later.
"This total restriction of movements order applies to all, except for Ambulances, Fire service trucks and others on essential duties," Police Inspector-General Suleiman Abba said.
Abba sparked outrage last week when he warned voters not to hang around polling stations after voting.
Electoral officials said on Tuesday that 82 percent of the electorate had collected the ID cards they need to vote.
There has been a push against Boko Haram militants in the past month, especially by neighbours Chad and Niger, chasing them out of much of the territory they had controlled and raising hopes that millions in areas affected by the insurgency, including a million internal refugees, will be able to vote.
"Wherever it is safe and people have resumed normal life, we will conduct elections," election commission head Attahiru Jega said. "We've also got arrangements to conduct elections for internally displaced persons. We have designated centres."
The commission said about 56.7 million voter cards had been collected by Nigerians. Jega said distribution had now ceased.
Track Latest News Live on NDTV.com and get news updates from India and around the world