Nigeria's state security agency on Tuesday freed a prominent journalist and opposition activist who had been held since August despite court orders demanding his release.
Omoyele Sowore -- a publisher of online news site Sahara Reporters -- still faces trial for treason and other crimes but was freed on bail under orders from the attorney general.
"Merry Christmas. I can't talk to the media now. I will arrange for that later," said Sowore, who was briefly freed on December 5 before being rearrested the following day.
His rearrest caused an outcry among local and international activists, who accuse the government of swerving towards authoritarianism as the number of people in illegal detention rises.
Sowore, an avowed government critic who stood for president earlier this year, was accused of treason after calling for mass protests against the government.
The State Security Services (SSS) -- Nigeria's domestic intelligence agency -- failed to comply with earlier court orders for his release.
But Attorney General Abubakar Malami said on Tuesday he had directed the SSS to comply with an order granting bail to Sowore and another detainee, former national security adviser Sambo Dasuki.
Dasuki has been in detention since 2015, despite multiple court orders for his bail release, over claims he misused roughly $2 billion (1.8 billion euros) in defence funds.
The money was earmarked for the fight against Islamic militant group Boko Haram but Dasuki allegedly used it to help bankroll former president Goodluck Jonathan's failed re-election campaign in 2015.
"The two defendants are enjoined to observe the terms of their bail and refrain from engaging in any act that is inimical to public peace and national security," Malami said, adding both trials would continue.
President Muhammadu Buhari, leader since 2015, promised to end graft in Africa's most populous country.
Critics accuse the former military ruler of carrying out a witch hunt against his opponents.