Abuja: Nigeria plans to withdraw much of its 1,200-strong contingent from international peacekeeping missions in Mali and Sudan’s Darfur region saying the troops are needed to beef up security at home, sources familiar with the matter said on Thursday.

Nigeria is battling Islamist group Boko Haram, but the troop withdrawal comes just ten days before a presidential election in Mali, which is meant to restore democracy after a coup and the occupation of the desert north by Al Qaida-linked rebels last year.

The 12,600-man UN mission in Mali is rolling out to replace most of the 4,500 French forces who intervened successfully in January to halt an Islamist advance south.

“It seems Nigeria is pulling out its infantry but leaving some other elements ... I think that it is because the troops are needed at home,” said a Nigeria-based diplomat.

A Nigerian military source and two other diplomats in West Africa confirmed the planned pullout, saying it was mainly due to the need to tackle the country’s own insurgency.

The UN peacekeeping department said Nigeria would also withdraw some of its troops from the UN-African Union force Unamid in Sudan’s conflict-torn Western Darfur region as well.

“We can confirm that Nigeria has officially notified [UN peacekeeping] of its intention to withdraw some of its troops — up to two battalions — from Unamid,” said UN peacekeeping spokesman Kieran Dwyer.

The United Nations was in discussions with other countries to replace the Nigerians, she said.

The standard size for a UN peacekeeping battalion is 850 troops but that is just a recommendation.

It was not immediately clear how many Nigerian troops would be withdrawn from Mali. One of the diplomats said engineers and signals operators would be amongst those left behind with the United Nations.

A two-month offensive against Boko Haram in northeast Nigeria since President Goodluck Jonathan declared a state of emergency in mid-May has stretched its security forces and new rotations are needed to go in.

Underscoring the fragile security in northeast Nigeria, Boko Haram — whose nickname roughly translates as ‘Western education is sinful’ — has targeted at least four schools there over the past month, killings dozens of pupils.

Mali’s own army remains weak, the result of years of corruption and neglect that led to several defeats by militants in the north followed by a coup by disgruntled officers in Bamako. Attacks on peacekeepers this month illustrated how delicate security remains in Mali’s north.

European Union troops are training the Malian army but are not expected to complete the programme until next March at the earliest.

Former minister Tiebile Drame, who drafted last month’s peace deal between Mali’s government and northern separatist rebels, pulled out of the July 28 presidential elections on Wednesday, arguing that Western pressure was pushing Mali into holding them before it is ready.

The withdrawal of Nigerian troops from Darfur comes at difficult time for Unamid, which according to the UN

peacekeeping department has more than 19,000 soldiers and police.

Violence has surged since January as government forces, rebels and Arab tribes, armed by Khartoum early in the conflict, fight over resources and land. Peacekeepers are often attacked when they try to find out what is happening on the ground.

Seven peacekeepers were killed and 17 wounded when they came under heavy fire from gunmen in Darfur on Saturday, Unamid said, the worst toll from a single incident since its deployment in 2008.