Another soldier then fired five shots at the man.
A soldier has been slightly injured in the Louvre attack.
Visitors to the Louvre learned by loudspeaker announcement of Friday's attempted attack on the Paris museum and there was no panic, witnesses said, though some children cried as guards directed people to sit tight together and away from windows.
Police have searched an apartment the man had rented in Paris and are now working to establish whether he acted alone, on impulse, or on orders from someone, prosecutor Francois Molins told a news conference on Friday night.
New Zealand Rugby saddened by Sione Lauaki passing
The Chiefs all stood tall in a circle, wearing black armbands to commemorate the 35-year old who played 70 Super Rugby games for the team.
A second person was detained after they were spotted behaving suspiciously near the scene, the police chief said.
Four soldiers were patrolling the Carrousel du Louvre, an underground shopping arcade adjoining the museum, at 9.45am (8.45am GMT) this morning when they were approached by a man near an escalator leading to the museum entrance.
Following the Paris atrocities of November 2015 in which 130 people were killed, and the Nice truck attack in July 2016 in which 86 people were killed, France has been on a high state of alert. One soldier received a "minor' head wound and has been taken to hospital, security forces said".
"This operation undoubtedly prevented an attack whose terrorist nature leaves little doubt", he said. "I heard no gunshots but I heard a lot of police sirens".
The official said the initial investigation found no record of political activism, criminal activity or membership of any militant groups at home.
N.Korean launch was of medium- or intermediate-range missile-US military
He said Trump had assured him of USA support and that Trump's presence showed the president's determination and commitment. The news of the missile test is just breaking, and comes from sources within South Korea news agency Yonhap.
Due to ongoing threats to France by Islamist terrorist group and recent French military intervention against Daesh (formerly referred to as ISIL).
Mr Brandet said about 1,000 people were inside the actual museum and were held inside in safe areas.
The attack forced the Louvre to shut down temporarily.
Armed soldiers have been on the streets of Paris and other cities since the state of emergency was declared.
Ashwin breaks Lillee record to quickest 250 wickets
I am not anxious about the first Test [in Wellington] where we had to play with five batters. Perhaps, only Sir Richard Hadlee with his contribution to New Zealand cricket comes close.