Friday's attacker slightly injured one of the soldiers, in the scalp, officials said.
The assailant allegedly stabbed one of the guards, injuring him lightly, said Michel Cadot, a senior police official in Paris.
There were no immediate details about the identity of the suspect.
The attacker reportedly pulled out a machete and attacked several soldiers after he was prohibited from entering a shopping mall beneath the museum bearing two backpacks.
The attacker cried out "Allahu Akbar", a French police spokesperson said, adding that no explosives have been found so far.
He added: "There was also a second individual who was behaving suspiciously, who has also been detained, but for now there does not appear to be a link between that individual and the attack". When he was refused entry he pulled out a knife and attacked him, prompting the soldier to open fire.
"There is a permanent terrorist threat hanging over France", said Interior Ministry spokesman Pierre-Henry Brandet.
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.
About 1,000 people, including museum staff and salespeople from the underground shopping centre where the attack occurred, were whisked into secured rooms for their protection.
The attack took place only hours before leaders of Paris's bid for the 2024 Olympics unveil their final candidate files.
Witnesses reported seeing a crowd of people running away from the scene and screaming.
The shooting comes with France on its highest state of alert, with thousands of troops patrolling the capital following a string of attacks in the past two years.
A total of 130 people were killed in Paris in the November 2015 attacks.
On Bastille Day, 86 people were killed, including two Americans, when a man driving a truck plowed through a celebration in Nice.