Nigeria's President Muhammadu Buhari has appointed new defence chiefs after sacking the heads of the army, navy and air force.
The sackings were expected as the president has repeatedly criticised the military's inability to defeat Islamist group Boko Haram.
The Islamists have recently launched a series of deadly guerrilla attacks, killing more than 250 people.
Boko Haram is thought to be responsible for more than 10,000 deaths since 2009.
Both the new head of the army, Maj Gen Tukur Yusuf Buratai, and the National Security Adviser, Maj Gen Babagana Monguno, are from Borno State which is at the heart of the conflict.
BBC Nigeria correspondent Will Ross says the hope is they have a good grasp of what is needed to end the violence.
The new military chiefs will be expected to work closely with neighbours Chad, Cameroon and Niger as they join forces to tackle Boko Haram.
The group has also stepped up attacks on these countries.
At least 12 civilians were killed in Cameroon in a suspected Boko Haram suicide attack on Sunday evening, a military source told the BBC.
Two soldiers also died, along with two bombers who blew themselves up in Fotokol, near the border with Nigeria.
Chad will be the headquarters of an expanded Nigeria-led regional force of around 7,500 troops.
Its formation has gained momentum since President Buhari took office in May.
Analysis: Will Ross; BBC News; Lagos
Some are asking why it took so long to make the changes.
So it was certainly not a surprise that President Muhammadu Buhari replaced all the military top brass.
Making progress in the fight against Boko Haram is his priority and he clearly wasn't happy with the status quo within the military.
Over the past three weeks Boko Haram has launched almost daily bomb attacks in cities in the north as well as blasts in Chad and Niger.
On Saturday morning, 15 people died in the main market in Chad's capital, N'Djamena, when a man dressed in a burka blew himself up.
Boko Haram claimed responsibility for the attack.
Our correspondent, Will Ross, says just hours before his sacking, army chief Lt Gen Kenneth Minima said the upsurge in violence was the result of military success against the jihadists.
Lt Gen Minima suggested Boko Haram no longer had the capacity to fight the army and so had resorted to attacking soft targets with bomb blasts.
Boko Haram at a glance
- Founded in 2002, initially focused on opposing Western-style education - Boko Haram means "Western education is forbidden" in the Hausa language
- Launched military operations in 2009
- Thousands killed, mostly in north-eastern Nigeria, abducted hundreds, including at least 200 schoolgirls
- Joined Islamic State - now calls itself "West African Province"
- Seized large area in north-east, where it declared caliphate in 2014
- Regional force retaken most territory