PARIS — Paris was plunged into panic — again — when soldiers guarding the Louvre Museum shot an attacker who lunged at them with two machetes Friday and shouted “Allahu Akbar!” as the landmark went into lockdown.

The threat appeared to quickly recede after the assailant was subdued, but it cast a new shadow over the city just as tourism was beginning to rebound after a string of deadly attacks. Coming hours before Paris finalized its bid for the 2024 Olympics, it also renewed questions about security in the City of Light.

The soldiers' quick action put an end to what French President Francois Hollande said was “no doubt” a terrorist attack at one of Paris' most iconic tourist attractions.

French prosecutor Francois Molins said the assailant was believed to be a 29-year-old Egyptian who had been living in the United Arab Emirates, though his identity has not yet been formally confirmed.

“Everything shows that the assailant was very determined,” Molins said at a news conference, adding that the attacker, who was shot four times, was in a life-threatening condition in a hospital.

Anti-terrorism prosecutors took charge of the investigation as police carried out raids near the tree-lined Champs-Elysees linked to the attack, which came two months after authorities carried out a special anti-terrorism exercise around the Louvre.

Molins said the attacker was not carrying any identity papers but investigators used his cellphone and a national database of visa applicants containing their photos and fingerprints to determine that he was a resident of the United Arab Emirates who arrived in Paris on a tourist visa Jan. 26.

Two days later the suspect bought two military machetes at a gun store in Paris, the prosecutor said. He also paid $1,833 for a one-week stay at an apartment in the chic 8th district of the French capital, near the Champs-Elysees.

In the apartment, police found an Egyptian passport and $1,041, as well as a residence permit, driver's license and a credit card all issued from the UAE, Molins said. He said the suspect's return flight to Dubai was scheduled for Sunday.

Friday's attack targeted an entrance to a shopping mall that extends beneath the sprawling Louvre, a medieval former royal palace now home to the “Mona Lisa” and hundreds of other masterpieces.

Waving two machetes over his head, the assailant lunged at the soldiers patrolling in the mall, shouting “Allahu Akbar!” or “God is great!” in Arabic, Molins said.

One soldier fought him off and was slightly injured in the scalp. Another soldier fell to the ground as the assailant tried to slash him, then opened fire, shooting the attacker in the stomach. When that didn't stop him, the soldier fired three more times, gravely wounding him. The backpack the man was carrying contained cans of spray paint, but no explosives, Molins said.

The 1,200 people inside the Louvre — one of the world's biggest tourist attractions — were first shuttled into windowless rooms as part of a special security protocol before being evacuated. The museum in central Paris remained closed for the rest of Friday but will reopen on Saturday, Culture Minister Audrey Azoulay told reporters.

Hollande, speaking at a news conference in Malta where he was attending a European Union summit, said that while the Louvre incident was quickly contained, the overall threat to France remains high.

Those patrols — numbering about 3,500 soldiers in the Paris area — were first deployed following the January 2015 attack on Paris' satirical magazine Charlie Hebdo and reinforced after the November 2015 bomb-and-gun attacks that left 130 people dead.

Interior Minister Bruno Le Roux praised the soldiers who stopped Friday's attack, saying “to wear a uniform, as we can see in the propaganda of those who want to attack us, is to be a target.”

The speed with which Paris largely went back to normal after the attack, with officers dismantling barricades and pulling down police tape around the Louvre three hours later, underscored how the French city has learned to live with extremist threats.

Within hours, French radio stations went back to talking about storms battering the west coast and school holiday traffic.