The Department of State Service (DSS ) has released Tony Ezimakor, Abuja bureau chief of Daily Independent newspaper, after seven days in detention.
Civil rights groups, human rights activists and different organisations had asked the secret police to release the journalist unconditionally.
He had honoured the invitation of the agency on Wednesday but was detained while Jide Oyekunle, the photojournalist, who accompanied him there was allowed to leave after some hours.
Since then, he was held incommunicado.
The service had threatened not to release him until he disclosed the source of a story he wrote on Boko Haram
Ezimakor had written a story detailing how the federal government allegedly paid millions of dollars in exchange for the release of 82 Chibok schoolgirls.
He also highlighted the role allegedly played by the Swiss government. A security source said the Swiss government was embarrassed over how such information was made public.
Maintaining that he would not disclose his source, the newspaper asked DSS to charge the journalist to court but the agency refused.
However, around 10:30pm on Tuesday, the DSS allowed Ezimakor to leave in the company of Douglas Ekhator, his lawyer.
Earlier on Tuesday, Femi Falana, human rights lawyer, said the action of the DSS was a reminder of how the military regime of Muhammadu Buhari jailed journalists.