PARIS — At least 13 people, including a child, were injured on Friday when a suspected explosive device went off near a bakery in the central French city of Lyon, local officials said.

The precise nature of the device was not immediately clear, and there were no claims of responsibility. But President Emmanuel Macron, in a live interview on YouTube, called it an “attack,” and the Paris prosector’s office said that it had opened a terrorism investigation.

France has been a target of terrorist plots in recent years, especially in 2015 and 2016, when Islamist extremists waged deadly, large-scale attacks. In the past few years, attacks have been rarer and much smaller in scale. In December, in the eastern city of Strasbourg, five people were killed by a gunman at a Christmas market.

Police and military patrols in urban areas have become routine, especially in crowded shopping areas and at sensitive sites like train stations.