PARIS — A raid led by French armed forces rescued four hostages in northern Burkina Faso on Friday, as a group of kidnappers were attempting to take them to Mali, the French authorities said. Two French soldiers died in the overnight raid.

The hostages included two Frenchmen, an American and a South Korean. It was not clear who had abducted them or was holding them, but a number of armed insurgent and terrorist groups, including the ISIS and Al Qaeda, operate in the region.

At a news conference on Friday, France’s armed forces chief, Gen. François Lecointre, said the hostages were on their way to be transferred to the Macina Liberation Front, an Islamist militant group in Mali, and that it would have been “absolutely impossible” to set up a raid once the hostages were in the group’s hands.

Patrick Picque and Laurent Lassimouillas, the two French citizens, were abducted on May 1 while on vacation in Benin’s Pendjari National Park, on the border with Burkina Faso, where terrorist groups have stepped up attacks in recent months. Their car was found burned and their driver dead.