Nigerian President Muhammadu Buhari has removed all military chiefs and replaced them with new faces in an attempt to take on the Islamist group Boko Haram amid surging violence.

The chiefs of defence, army, air force, navy and intelligence departments have all been sacked besides the National Security Adviser, Colonel Sambo Dasuki.

"The president has relieved the service chiefs, including the heads of the army, air force and the navy of their appointments," government spokesperson Femi Adesina told reporters.

Newly-appointed chief of army Major General Tukur Yusuf Buratai and National Security Adviser Major General Babagana Monguno are from the restive Borno State, the nucleus of Boko Haram violence.

"All of you, including the national security adviser, were chosen on merit. Your records gave you the job," Buhari told a press conference.

The shake-up does not come as a big surprise since Buhari won the recent election pledging a series of changes in the security establishment. The country's defence command centre has already been relocated to Maiduguri, the hotspot of Boko Haram militants.

All the appointments are of an interim nature until the senate formally ratifies them. Many of the sacked authorities were caught unawares and briefly went on with their routines even after the new appointments were announced.

The incoming service chiefs are likely to work closely with neighbouring African nations - Chad, Niger and Cameroon - to oversee the coordinated operations against Boko Haram militants.