Soldiers arrived Sunday afternoon at the Daily Trust office in Maiduguri, where Boko Haram was founded, and rounded up two journalists working there, Uthman Abubakar, a regional editor, and Ibrahim Sawab, a reporter who has worked in the past for The New York Times. The men were detained in a military barracks.

Mr. Sawab was released several hours later, but Mr. Abubakar remained in custody on Monday, colleagues said.

Later Sunday afternoon, armed soldiers in five vehicles stormed the paper’s main office in the capital, Abuja, and ordered journalists working inside to evacuate. They occupied the building for four hours, according to Mannir Dan-Ali, the paper’s editor in chief, ransacking the newsroom and carting away dozens of computers. Soldiers also entered the newspaper’s offices in Lagos and Kaduna.

Their actions “strangulated the production of the Monday edition of the paper,” Mr. Dan-Ali said.

President Muhammadu Buhari, who is running for re-election next month, made big gains against Boko Haram when he first took office in 2015, but some of that success has slipped away in recent months, as the group has carried out a series of successful attacks against the military. Boko Haram fighters have killed dozens of soldiers, even posting online a gruesome video of one attack, and rumors have circulated that they once again control some territory in the country’s northeast.

Soldiers have complained about long tours of duty that have left them with no days off for months, worn-out equipment and low rations, according to local news reports. The military has disputed all such claims.