Nigeria is planning to withdraw some of its 1,200 soldiers from the UN peacekeeping force in Mali, Ivory Coast President Alassane Ouattara has said.
Mr Ouattara, head of the regional group Ecowas, said the troops were needed at home to tackle militant Islamists.
It is not yet clear how many Nigerian troops will stay in Mali, where an election is due to be held on 28 July.
The Nigerians are part of a force of 6,000 African troops who took over from a French-led mission on 1 July.
French and West African troops drove militant Islamists out of northern Mali in February.
The UN force - known by its French acronym Minusma - is now working with the Malian army to provide security for the election. It is due to be expanded to 11,200 troops, plus 1,400 police, by the end of the year.
President Ouattara, speaking at a summit of West African nations in the Nigerian capital Abuja, said the withdrawal was "because of the domestic situation in Nigeria".
"They are not withdrawing everyone. A good part of the troops are going to be there," he said.
The BBC's Alex Duval Smith in Bamako says a full battalion of Nigerian soldiers - 850 men - will be withdrawing after the elections, which could go to a second round on 11 August.
Once they have gone, the Nigerian contribution will be limited to 140 police, some staff officers and a field hospital based near the northern town of Timbuktu, she says.
The Nigerian withdrawal will be a blow for the new UN force, our correspondent says.
An unnamed military source told the AFP news agency that the move was partly in protest after a non-Nigerian was named to head Minusma.
"Nigeria feels shabbily treated... we think we can make better use of those people at home than to keep them where they are not appreciated," the source said.
Nigerian soldiers are also being pulled out of the joint UN-African Union mission in Sudan's Darfur region, according to Reuters news agency.
More than 2,000 people have been killed since militant group Boko Haram launched its insurgency in 2009 to create an Islamic state in the mainly Muslim north of Nigeria.
A state of emergency was declared on 14 May in the north-eastern states of Adamawa, Borno and Yobe, with more than 2,000 soldiers deployed to break up Boko Haram camps and insurgent operations.
This month's election in Mali is intended to end months of political crisis that started when soldiers overthrew President Amadou Toumani Toure in March 2012, allowing separatist rebels and Islamist militants to seize the north of the country.
France - the former colonial power in Mali - and sent more than 4,000 troops, backed by soldiers from African countries, there in January after rebels threatened the capital.
Western donors have agreed a $43bn (£28bn) package for Mali's economic recovery plan linked to the implementation of a political road map that includes the elections.