DAKAR, Senegal — France has called five African presidents to a meeting on Monday to disavow rising anti-French hostility in their countries, work out how to stop the rapid advance of armed Islamist extremists in their region and determine whether France will remain deeply engaged in that fight.

France could withdraw its 4,500 soldiers, President Emmanuel Macron has said, if the leaders of Mali, Niger, Burkina Faso, Chad and Mauritania do not answer questions to his satisfaction. That warning came as the United States also considers pulling troops from the region.

Many analysts say the French and Americans are making empty threats when they talk about leaving the Sahel, a semiarid area stretching more than 2,000 miles across West and Central Africa that is plagued by violent groups loosely affiliated with the Islamic State and Al Qaeda. But their warnings illustrate the allied nations’ frustration with extremist gains, and with one another.

France, the five countries’ former colonial ruler, initially intervened in 2013 to oust rebels and Islamist militants who had taken control of northern Mali in the wake of Libya’s descent into chaos. The militants regrouped, and now extremist-related violence is rising fast, doubling every year since 2015.