A French soldier shot and seriously wounded a man armed with machetes who attacked him on Friday near the entrance to the Paris Louvre museum shouting Allahu Akbar (God is greatest), in what President Francois Hollande said was a terrorist attack.

Police inquiries had established that the man, who was hovering between life and death after being shot, was a 29-year-old Egyptian who arrived in France on Jan. 26 after obtaining a tourist visa in Dubai, the Paris prosecutor said.

Security sources in Cairo identified the man as Abdullah Reda al-Hamamy, who was born in Dakahlia, a province northeast of Cairo.

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.

The man was wearing a black T-shirt with a death's head emblem when he attacked soldiers checking bags near the museum's shopping mall "with a machete in each hand", Molins said.

He struck one soldier and knocked another one to the ground. When he continued his attacks the soldier on the ground shot him in the abdomen, Molins said.

Paintspray cans - but no explosives - were found in his back pack, a source close to the investigation told Reuters.

READ: French soldier shoots, wounds machete-wielding attacker at Paris Louvre