A 29-year-old Egyptian man is believed to be the attacker at the Louvre museum on February 3, French authorities said.
Prosecutor Francois Molins said the man is thought to have traveled to Paris from Dubai on a tourist visa last month.
Police are trying to establish if the man acted alone or under instructions, he added.
Prosecutor Francois Molins stated the attacker, who was shot by the soldiers, sustained life-threatening injuries, though he is at a hospital. Molins added the man had no identifying documentation, but investigators used his cellphone to determine his resident in the UAE.
One of the soldiers received minor injuries when the man tried to enter the museum.
At the time of the incident, hundreds of visitors were inside the Louvre, which is home to numerous celebrated art works, including the Mona Lisa.
France’s President Francois Hollande praised the soldiers’ actions, saying “this operation prevented an attack whose terrorist nature leaves little doubt”.
The president told reporters at an EU summit in Malta on the day of attack that he expected the suspect to be questioned “when it is possible to do so”.
Prosecutor Francois Molins said the Egyptian man had no identity papers but mobile phone data showed he had arrived in Paris on January 26 after acquiring a one-month tourist visa in Dubai.
However, the prosecutor cautioned, the authorities have not yet formally established the suspect’s identity.
Egyptian security sources though say they have identified him, Reuters reports.
The man was believed to have been staying in Paris’ 8th district (arrondissement) which was searched in a police raid earlier on February 3.
There, he bought two machetes from a shop selling guns.
According to the prosecutor, the attacker, armed with the machetes, approached four soldiers guarding the entrance to crowded shops beneath the Louvre just before 10:00 local time.
When the soldiers challenged him, he attacked two of them while shouting in Arabic “Allahu Akbar” (“God is greatest”). One of them shot him at least three times, hitting him in the stomach.
“The attacker fell to the ground, seriously wounded. He has been taken to hospital and is fighting for his life,” Francois Molins said.
The attacker was carrying a backpack which contained paint spray cans – but no explosives.
The guards on patrol outside the museum were just some of the thousands of troops lining the streets as part of the stepped-up response to a series of attacks in France since 2015.