Anti-terrorism prosecutors took charge of the investigation and French President Francois Hollande said the assailant would be questioned "when it is possible to do so".
Yves Lefebvre, a police union official, says the man tried to stab one of the soldiers.
One of the soldiers sustained a minor scalp injury as a result of the attack.
When he was refused entry to the shopping center, the man pulled out a knife and attacked the soldier, yelling "Allahu akbar", AFP reported, meaning "God is great" in Arabic.
The suspect is said to be in his mid-30s and did not have any identity papers.
Police held hundreds of tourists in secure areas of the renowned museum in central Paris after the assailant was shot five times around 10:00 am (0900 GMT) in a public area inside the Louvre complex. "Notably he shouted "Allahu Akbar", Cadot told reporters.
French police said a second person who was acting suspiciously was also detained.
Black History Committee hopes events will have impact on students
Trump has used street violence in Chicago consistently as an example of what he has called "carnage" in America's inner cities. The person President Trump celebrated the most was himself, and the struggles he spent the most time describing were his own .
Facebook just set a record in quarterly user growth
Mark Zuckerberg , Facebook founder and chief executive, said: "Our mission to connect the world is more important now than ever". Adjusted earnings for the quarter rose to $4.15 billion or $1.41 per share from $2.27 billion or $0.79 per share past year .
West Ham v Man City Preview
He is one of the nicest guys I've ever met. what happened against Chelsea [a shove on Cesc Fabregas] we have talked about a lot. Pep Guardiola's team have dropped down the league table and are now in fifth place 13 points behind leaders Chelsea.
Paris Mayor Anne Hidalgo praised the actions of the soldiers, who are part of the "Sentinel Operation", an anti-terror security operation instituted after the 2015 terror attack on the satirical magazine Charlie Hebdo.
Police officers take their positions after a soldier opened fire outside the iconic Louvre museum..
The museum, one of the French capital's most popular tourist attractions, was put on lockdown after the attack and as many as 250 visitors were.
Paris was also planning to submit its official bid to host the 2024 Olympic Games on Friday with a launch show at the Eiffel Tower around 1730 GMT.
Witnesses reported seeing a crowd of people running away from the scene and screaming.
Military patrols in Paris have become a common sight since 2015's terror attacks in Paris.
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.
On Bastille Day, 86 people were killed, including two Americans, when a man driving a truck plowed through a celebration in Nice.