Here in the country’s northwest, St.-Louis is the kind of place that could draw terrorists’ attention. With its fading colonial architecture and horse-drawn carts, West Africa’s first French settlement retains much of its old European charm. The arches of the bridge leading to the old town center — on an island in the mouth of the Senegal River — were designed in the late 19th century by Gustave Eiffel.

Today, the city of 175,000 people is no longer a thriving colonial capital, but it is a Unesco World Heritage site that is considered culturally significant and hosts an internationally renowned jazz festival every May, drawing tourists from Africa and Europe. St.-Louis also spills into a bustling, raucous fishing village, where scores of colorfully painted wooden boats, called pirogues, bring in a daily catch that is an economic lifeline.

In other words, it is just the kind of soft target frequented by foreigners, albeit somewhat off the beaten path, that extremists could strike someday, Senegalese and other Western officials said.

As part of the Pentagon’s Flintlock 2016 drills, an annual exercise in northwestern Africa, Senegal and Mauritania asked military planners this year to include riverine training for their forces. Mauritanian commandos are working with British trainers up river at Rosso on the Mauritanian side.

The exercise pairs Western trainers with African partners in different outposts scattered around Senegal and Mauritania. In Senegal, for instance, Estonian alpine experts are training Senegalese special forces; Italian commandos are working with troops from Chad; and Austrian special forces are also with Senegalese soldiers.

Dutch marines, who have been training with Senegalese naval forces since 2007, were a natural fit for the new riverine mission. The recent beach landing was the first phase in training that over the next two weeks will build up to a two-day simulated mission with a night landing — as the commandos would do in a real operation to preserve the element of surprise and allow more time to surveil the target.