N’DJAMENA (Reuters) - Chad, a key ally of the West in the fight against Islamist militants in West Africa, said on Thursday it has closed its long border with Libya and will deploy troops to the area in an effort to prevent the influx of militant fighters fleeing conflict in its war-torn northern neighbor.

Libya has slid into lawlessness since the 2011 uprising that toppled Muammar Gaddafi. Although Islamic State has been ousted from its former stronghold of Sirte, the country’s U.N.-backed government has largely failed to retain control.

Chad, worried that fighters will flee south across the border, said on Thursday it would take immediate action.

“Some isolated ... groups have converged toward the south of Libya, that is to say on the northern border of our country, which is potentially exposed to a serious threat of ... infiltration,” Chad’s Prime Minister Albert Pahimi Padacke said in a statement, declaring the border region a “zone of military operation.”

Despite a struggling economy, Chad’s army has become one of the region’s strongest, and it now plays a key role in efforts to combat Boko Haram - an Islamic State affiliate group - in neighboring Nigeria. It also confronted attacks by the Islamist militant group on its own soil.

But the vast desert borders of West and North Africa are notoriously difficult to police, and militants can often roam between countries free and undetected.