Nigeria’s sacked national security adviser, Sambo Dasuki, has appeared in court in the capital, Abuja, charged with illegally possessing weapons.
Nigeria’s intelligence agency said it had seized firearms during a raid on his properties in July.
Mr Dasuki pleaded not guilty to the charge and was given bail.
He is the first senior official of the former government to be charged since President Muhammadu Buhari was inaugurated in May.
Mr Buhari is the first opposition candidate to be elected president in Nigeria.
The judge ordered the agency to return Mr Dasuki’s passport to the court as part of his bail conditions.
Mr Dasuki appeared calmed and relaxed, reports the BBC’s Nasidi Adamu Yahya from the court.
Some associates of former President Goodluck Jonathan were present in solidarity to the retired army officer, he says.
President Buhari replaced Mr Dasuki and other security chiefs in July in a renewed effort to end a six-year insurgency by militant Islamist group Boko Haram.
This has been a swift change of fortune for the man who was an extremely powerful figure in the immediate past administration.
As the National Security Advisor, he oversaw the fight against Boko Haram and as a sign of how influential Col Dasuki was, it was on his advice that this year’s elections were postponed – a move which some believed was aimed at buying time to give Mr Jonathan a boost.
Apart from the accusation of possessing illegal weapons, Mr Dasuki may have bigger problems ahead.
He may be asked to help explain where the $5bn (£3.3bn) annual security budget went, especially as it became clear that for some time the Nigerian military did not have the weapons it needed to fight the jihadists.
Some Nigerians accuse President Buhari of pursuing a personal vendetta. Thirty years ago Sambo Dasuki was reportedly amongst a group of officers who arrested Gen Buhari who was then the military head of state.
He has however denied that he was present when the arrest took place and Mr Buhari was toppled.