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.