The Nigerian army says it raided the offices of the private Daily Trust newspaper for “undermining national security” by reporting about a planned operation against militant Islamists.
The article “put troops in imminent and clear danger”, it said in a statement.
Two reporters at the newspaper’s office in the north-eastern city of Maiduguri, the epicentre of the Boko Haram insurgency, were arrested.
Daily Trust condemned the raid and asked for its staff to be released.
The newspaper reported on Sunday that an offensive was being planned to retake control of territory captured recently by militant Islamists in north-eastern Borno state.
The army said it did not intend to muzzle the press, but it was forced to act because the newspaper had divulged “classified security information”.
“It afforded the Boko Haram terrorists prior notice of our plans and giving them early warning to prepare against the Nigerian military, thus sabotaging the planned operations and putting the lives of troops in imminent and clear danger,” the army statement said.
Daily Trust editor-in-chief Mannir Dan-Ali said the raids on the newspaper’s offices in Maiduguri and the capital, Abuja, were “unlawful”.
The soldiers sent away staff from the offices and ransacked the newsroom and carted away dozens of computers, he added in statement.
Witnesses told the BBC the soldiers then ordered staff to hand over all computers and laptops and had taken over control of the Abuja office.
Dan-Ali said the regional editor in Maiduguri, Uthman Abubakar, and reporter Ibrahim Sawab, were still being held.
Boko Haram insurgents, who have caused havoc in north-eastern Nigeria since 2009, are fighting to overthrow the government and create an Islamic state.
According to the Daily Trust, a well respected daily paper, the soldiers forced open the gates of its head office in Abuja and drove in with three vans loaded with armed soldiers.
Last week, witnesses told the BBC that militants linked to the Islamic State (IS) group had hoisted their flag in the fishing town of Baga, causing hundreds of people to flee.
The militants from Islamic State’s West Africa Province (Iswap), a Boko Haram offshoot, seized weapons from a military base, and torched a naval base on the shores of Lake Chad, they said.
In the Daily Trust’s article it said that an offensive was being planned to retake control of Baga and the towns of Doron-Baga, Kross Kawwa, Bunduran, Kekeno and Kukawa that had also recently been captured by Iswap.
Correspondents say the military is sensitive to criticism and often refuses to admit to failures in its battle to defeat the insurgents.
More on the Boko Haram insurgency:
In November it took nearly a week for the army to acknowledge that its base in Metele had been overrun by militants.
There has been an escalation of attacks by the militants in the run-up to elections next month.
President Muhammdu Buhari, who is seeking a second term, took office in 2015 with a promise to defeat the militants.
While the army has retaken most of the territory the militants once controlled, they remain capable of carrying out deadly attacks.