PARIS — A man with a machete was shot by a French soldier Friday after he lunged at four soldiers, shouting “God is great” in Arabic near the Louvre Museum in Paris, police said, raising tensions in a country that has been the site of several terrorist attacks in the past two years.
Paris police Chief Michel Cadot said the man, who had life-threatening injuries, had been carrying two backpacks but that there was no indication they had contained explosives.
The Paris prosecutor’s office opened a terrorism investigation, but authorities said the suspect’s motives were unclear. President Francois Hollande said he had ‘‘no doubt’’ it was a terrorist attack.
The suspect is believed to be an Egyptian national, Associated Press reported, citing two police union officials said.
Police carried out raids near the tree-lined Champs-Elysees after the attack. A second person was taken into custody, said Pierre-Henry Brandet, an Interior Ministry spokesman, but that person’s connection to the assault is unclear.
The suspect was shot five times at the bottom of a stairway that connects the Tuileries Garden with the Carrousel du Louvre, an underground shopping center through which visitors can also gain access to the museum. But he did not reach the typically crowded mall itself, nor the main entrance of the museum.
One soldier suffered a minor scalp injury, officials said.
France has been under a state of emergency for more than a year, since attacks in and around the city in November 2015 left 130 people dead, and it has since been hit by several deadly assaults.
Although the effectiveness of deploying soldiers alongside police officers and gendarmes to protect civilians has been questioned — about 10,000 soldiers around the country are now on patrol — their presence is an increasingly accepted feature of the country’s efforts to confront the terrorist threat.
President Trump said on Twitter, said: “A new radical Islamic terrorist has just attacked in Louvre Museum in Paris. Tourists were locked down. France on edge again. Get smart US.” But there was no publicly available information to support his claim about the assailant.
Authorities cordoned off the large central courtyard of the Louvre, which has long been considered a possible target of extremists, and the museum was put under tight security.
Photographs posted on Twitter showed visitors to the museum sitting on the floor, checking their smartphones, and then leaving after the authorities had brought the situation under control.
According to the French Interior Ministry, about 250 visitors were in the museum at the time of the attack, in the morning, when the venue is less crowded. It also draws far fewer visitors in the winter, low season for tourism, than in the summer.
Those who were inside the museum were moved to secure areas, the police chief said, and no one else was allowed to enter. The roughly 1,000 people who were inside the blocked-off area were let out around midday.
As the tensions of the morning eased, the main courtyard that surrounds the glass pyramid designed by I.M. Pei, which anchors the museum’s main entrance, was still empty because the police had sealed it off.
The police later reduced the size of the security perimeter, but the culture minister, Audrey Azoulay, said the museum would be closed for the rest of the day, despite earlier optimism that visitors would be allowed back in during the afternoon. The museum is expected to reopen Saturday.
The Rue de Rivoli, which runs along the northeast side of the museum and is lined with shops and restaurants catering to tourists and occupying centuries-old arcaded buildings, remained at least partly open to pedestrian traffic, although other streets were blocked off.
France has been on edge because of the serious threat posed by terrorism, most notably the coordinated assaults in November 2015. In June, an off-duty police officer and his companion were stabbed to death by a man who then filmed himself claiming allegiance to the Islamic State group, broadcasting the video on Facebook.
On July 14, a man driving a truck plowed into a crowd celebrating Bastille Day in the southern city of Nice, killing 86. Twelve days later, two men burst into a church during morning Mass in the northern town of St.-Étienne-du-Rouvray and slaughtered a priest, Jacques Hamel.
Many of the assailants have said they were inspired by the Islamic State, but several had links to a wider network of terrorists.
Over the summer, most notably during the Euro 2016 soccer championship, France heightened security measures and conducted raids of possible terrorist cells.