ABUJA (Reuters) - Nigeria’s military has released an editor two days after detaining him over an article about a planned offensive against Islamist militants in the northeast, his newspaper said.

The Daily Trust newspaper head office is pictured in Abuja, Nigeria January 9, 2019. REUTERS/Afolabi Sotunde

Soldiers raided the Daily Trust’s offices in the capital Abuja on Sunday in an operation that the Committee to Protect Journalists said showed “a dearth of respect for press freedom” a month before elections.

Soldiers also shut down the newspaper’s bureau in the northeastern city of Maiduguri where they detained regional editor Uthman Abubakar. The military later said the article had “divulged classified military information” and the action was meant to show the seriousness of the breach.

Islamist militants have stepped up attacks in the northeast in recent months, piling pressure on President Muhammadu Buhari, who came to power in 2015 promising to crush the insurgency and faces fresh elections on Feb. 16.

The military has complained in the past about critical coverage of its fight against the militants from the Boko Haram separatist group, and their more lethal offshoot Islamic State West Africa. But it had stopped short of arresting reporters.

Abubakar was brought back to the paper’s Maiduguri office and released without charge on Tuesday, the Daily Trust said in an article. The bureau was reopened a day earlier.

The regional editor said he was “courteously treated” but “his mobile phones and laptop were still with the military as the authorities said they needed time to finish the forensic checks being carried out on the equipment,” the paper said.

Its chief operating officer, Mannir Dan Ali, called the arrests “totally uncalled for and condemnable,” in interviews on local media.

The military did not immediately comment on the release.

The government’s chief spokesman, Lai Mohammed, said on Tuesday that while authorities “are not about to gag the press,” the media “must exercise greater restraint” reporting on the northeast insurgency.

Some publications were “demoralising the military and strengthening the insurgents,” he said, without providing details.

A second Daily Trust journalist detained in Maiduguri was released eight hours after the raid.