A spokesman says Nigeria's new president will visit Chad and Niger, making the countries whose troops help fight Boko Haram a priority on his first official travels outside the country.

Spokesman Garba Shehu says President Muhammadu Buhari will fly to Niger on Wednesday and Chad on Thursday.

Chad leads a multinational force of troops, including soldiers from Cameroon, in an offensive that this year has driven Nigeria's home-grown Islamic extremists from the towns and villages where it had established "an Islamic caliphate."

Chad's President Idriss Deby has complained of a lack of cooperation from Nigeria, which has strained relations with all its neighbors.

Nigeria's military has said the offensive has cut Boko Haram's supply lines across borders and that the militants' main fighting force is hemmed into a northeastern forest.