ABUJA (Reuters) - Nigerian soldiers raided the offices of the country’s Daily Trust newspaper and arrested two of its journalists following an article about the military’s fight against Islamist militants in the northeast, the newspaper said on Sunday.

The Daily Trust published photographs on its website of armed soldiers raiding its head office in the capital, Abuja. The newspaper also said the military had shut down its office in the northeastern city of Maiduguri after arresting a regional editor and a reporter.

An uptick in attacks by Islamist militants in recent months has made security a key campaign issue ahead of the Feb. 16 presidential election in which Muhammadu Buhari will seek a second term.

The Nigerian army said in an emailed statement that the paper, in an article published on Sunday, had “divulged classified military information, thus undermining national security”.

It said the journalists were arrested in order for them to realize the importance of national security and that the military did not intend to silence the press.

The statement was issued hours after the presidency commented on the raids.

“The Federal Government has directed the military to vacate the premises of @daily_trust and the order has been complied with,” the president’s spokesman, Garba Shehu, said on Twitter.

“Issues between the military and the newspaper as they affect the coverage of the war in the Northeast will be resolved through dialogue,” he added.

Also on Twitter, the main opposition party’s candidate, Atiku Abubakar, said press freedom was the bedrock of Nigeria’s democracy and “nothing should be done to compromise it”.

The Islamist militant group Boko Haram has killed about 30,000 people since 2009 in an insurgency aimed at creating an Islamic caliphate in northeast Nigeria.

It was pushed out of most of the Belgium-sized swathe of territory it controlled in early 2015. But a faction that broke away in 2016 - Islamic State in West Africa (ISWA) - has claimed responsibility in the past few months for a series of attacks on military bases and strategically located towns.

The group attacked Baga - a town that borders Niger, Chad and Cameroon - in December, forcing hundreds to seek safety in Maiduguri, 200 km (125 miles) to the south.

Opponents of Buhari - a military ruler in the 1980s who was voted into office in 2015 - have criticized his security record, pointing to such incidents and an attack on an army base in Metele, Borno state, in which about 100 soldiers were killed.