The incident on Friday has thrust security and the terror threat back into the limelight three months before elections in France, with authorities saying it was a “terrorist” assault.
The attacker, who is thought to be aged 29 and living in the United Arab Emirates, is believed to have entered France legally on a flight from Dubai on January 26, a source said.
An Egyptian passport, thought to be the suspect's, was found during a search of an apartment in an expensive district of Paris near the Champs-Elysees.
Wearing a black t-shirt bearing a skull design and armed with two 40-centimetre (16-inch) machetes, the attacker lunged at four patrolling French soldiers while shouting “Allahu Akbar” (“God is greatest”), Paris prosecutor Francois Molins told a press conference.
One of the troops was struck on the head and another fell to the ground outside the famous Paris museum after the assailant attacked. The second soldier managed to open fire and hit the machete-wielder in the stomach.
“The attacker fell to the ground, seriously wounded. He has been taken to hospital and is fighting for his life,” the prosecutor said.
A source later said that the suspect's condition had stabilised. Security forces said one soldier had suffered a minor head wound.
Police held hundreds of tourists in secure areas of the world famous attraction after the assailant was shot five times around 10:00 am (0900 GMT) in a public area near one of the museum's entrances.
Investigators are examining the Twitter account of an Egyptian man named Abdallah El Hamahmy after around a dozen messages were posted in Arabic between 9:27 am and 9:34 am, just minutes prior to the attack.
“In the name of Allah… for our brothers in Syria and fighters across the world,” El Hamahmy wrote, before making reference to the Islamic State jihadist group in another tweet a minute later.
The UAE government condemned the “hateful crime” and assured France of its “full solidarity”.
As French authorities probed the attacker's background, President Francois Hollande said that “there is little doubt as to the terrorist nature of this act,” an assessment echoed by Prime Minister Bernard Cazeneuve.
France was already reeling from a string of terror attacks over the last two years and the country has been under a state of emergency since November 2015.
The economy, immigration and security are major issues for voters ahead of this year's presidential and parliamentary elections forecast to confirm the country's shift to the right after five years of Socialist rule.
US President Donald Trump tweeted that a “new radical Islamic terrorist has just attacked in Louvre Museum in Paris. Tourists were locked down. France on edge again. GET SMART US.”
Witnesses described scenes of panic as people fled the Louvre complex following the incident.
“We heard gunshots. We didn't know what it was about. Then we evacuated the employees and we left,” one man who works in a nearby restaurant told AFP.
A female colleague said: “We saw death coming for us, with everything that's happening at the moment. We were very, very scared.”
The Louvre closed following the attack — but will re-open on Saturday at 10:00 am.
Paris' lucrative tourism industry has been a major casualty of the terror attacks, with visitors cancelling or shortening their stays.
The Louvre, a former palace in the heart of the city, has seen annual visitor numbers fall by some two million since 2015 to 7.3 million after the spate of attacks across France hit its claim to be the world's most visited museum.
The series of terror attacks in France began in January 2015 when jihadist gunmen rampaged through the offices of the Charlie Hebdo satirical newspaper and a Jewish supermarket in Paris, leaving 17 people dead in three days of bloodshed.
Ten months later, gunmen and suicide bombers from the Islamic State jihadist group attacked bars, restaurants, a concert hall and the national stadium in Paris, killing 130 people.
And last July, a Tunisian extremist rammed a lorry through crowds celebrating Bastille Day in Nice on France's south coast, crushing 86 people to death.