Nigerian President Muhammadu Buhari on Tuesday replaced the country's top military commanders in a sudden overhaul after months of pressure over deteriorating security.
Buhari, a former army general, was first elected in 2015 on vows to crush a bloody jihadist insurgency in northeastern Nigeria, but his armed forces have struggled against the militants.
"President Muhammadu Buhari has accepted the immediate resignation of the service chiefs," a presidency statement said, referring to the chief of defence staff and the chiefs of the army, navy and air force.
The statement did not give any reasons for the overhaul, but it came after the army suffered a string of blows in the field.
Opposition leaders and even some Buhari allies have been pushing for his government to revamp the military command.
For more than a decade, Nigeria's military has battled an insurgency by the Islamist group Boko Haram that has devastated the northeast, killing at least 36,000 people and displacing more than two million.
The Islamic State in West Africa (ISWAP), a rival jihadist group that split from Boko Haram in 2016 and is backed by the Islamic State, has in recent years stepped up deadly attacks on military bases.
The country is also struggling with a widening conflict over land and resources between mainly Christian farmers and nomadic mostly Muslim herders in which thousands have died.
In a security embarrassment last month, gunmen abducted hundreds of school students in Buhari's own home state of northwest Katsina. Most of the students were later released, but the incident sparked outrage and protests against visiting government officials.
Among the new appointments were Major-General Leo Irabor as chief of defence staff and Major-General Ibrahim Attahiru as army chief.
Local residents in the northeast described the pair as former field commanders who knew the terrain and the insurgency well.
"I think the change will have impact on the ground," said Idayat Hassan, director of the Abuja-based Centre for Democracy and Development think thank.
"The new chief of defence staff has been a boot on the ground for years."
Late last year, northeast Borno State Governor Babagana Zulum, a Buhari ally, openly criticised the army's response to violence after an increase in highway abductions in his state, the birthplace of Boko Haram.
"If the army cannot protect people travelling within a distance of only 20 kilometres (12 miles), then I cannot foresee the capacity of the army ending this insurgency any time soon," he told reporters.
Since the start of the year, militants have killed at least 19 troops in a suicide attack and a separate ambush on a military convoy in the northeast.
In their latest major attack this month, ISWAP jihadists briefly captured a military base in Borno state after overnight clashes with troops.
Fighters attacked the base in the town of Marte in the Lake Chad area before the army recaptured it hours later.
ISWAP maintains camps on islands in Lake Chad -- where Nigeria, Niger, Cameroon and Chad meet -- and the area is known to be the group's bastion.
A week earlier jihadists attacked the Marte base but were repelled, prompting them to mobilise more fighters for the overnight raid.
The raid was seen as a show of force after recent militant losses -- troops overran ISWAP's second largest camp in Talala village, military sources said at the time.