A suspected terrorist has attempted to attack a French soldier with a machete near Paris' famed Le Louvre art gallery.

Yves Lefebvre, a police union official, said Abdullah Reda al-Hamamy launched his attack when four soldiers guarding the area told him he could not enter the Carrousel du Louvre shopping centre with his bags.

“That's when he got the knife out and that's when he tried to stab the soldier,” he added.

French police officers and soldiers patrol in front of Le Louvre museum after an attempted attack on a soldier on 3 February (AFP/Getty Images)

Paris prosecutor Francois Molins identified the 29-year-old Egyptian national who had arrived in the capital on 26 January after acquiring a one-month tourist visa in Dubai.

He is said to be in a life-threatening condition in hospital after being shot by officers during the incident at 10am local time (9am GMT).

Michel Cadot, the head of Paris police, said the man was shouting "Allahu akbar" and injured the soldier's scalp before troops opened fire.

“We are dealing with an attack from an individual who was clearly aggressive and represented a direct threat, and whose comments lead us to believe that he wished to carry out a terrorist incident,” Mr Cadot told reporters.

“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."

Police say they are now trying to establish whether he acted alone or under instructions.

The attacker was shot five times and hit in the stomach but survived, Mr Cadot added. A photo from inside the shopping centre entrance showed the man lying on the floor at the foot of a staircase, wearing light trousers and a black top.

The image, obtained by Le Figaro, was taken by a tour guide who had been leading a group of Chinese tourists.

Police union officials said he was carrying a second machete, while local reports said cans of spray paint were also found in his bag.

Bomb squads were deployed to check the area for safety but found no explosives in two backpacks the attacker was carrying.

Francois Hollande, the French President, hailed the “courage and determination” of the military in the face of with “savage aggression”.

He told reporters at an EU summit in Malta that there was no doubt the attack was of a "terrorist nature".

Mr Hollande claimed the situation in Paris was "totally under control" and said the assailant would be questioned "when it is possible to do so".

Prime Minister Bernard Cazenueve “attempted assassination” was being treated as a terror attack, amid the country's continuing state of emergency.

Within hours of the incident, armed police launched numerous searches, including one at an apartment in Paris' 8th arrondissement.

Donald Trump seized on the attack in an apparent attempt to support his ban on refugees and immigrants from Muslim-majority "countries of concern".

Calling the suspect a "radical Islamic terrorist", he tweeted: "Tourists locked down. France on edge again. GET SMART U.S."

Terrorism in 2016: Terror attacks in Europe claimed by Isis Show all 9 1 /9 Terrorism in 2016: Terror attacks in Europe claimed by Isis Terrorism in 2016: Terror attacks in Europe claimed by Isis Policemen outside Rouen's cathedral during the funeral of Jacques Hamel, the priest who was killed in a church in Saint-Etienne-du-Rouvray in Normandy on 26 July during a hostage-taking claimed by Islamic State group Joel Saget/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Two jihadists, both 19, slit Hamel's throat while he was celebrating mass in an attack that shocked France as well as the Catholic Church Joel Saget/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Muslims place flowers and hold a minute of silence in front of the church if Saint-Etienne-du-Rouvray, western France, where French priest Jacques Hamel was killed on 26 July Charly Triballeau/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Two people hold each other by the new makeshift memorial in Nice, in tribute to the victims of the deadly Bastille Day attack at the Promenade des Anglais Valery Hache/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis The Islamic State group claimed responsibility for the truck attack that killed 84 people in Nice on France's national holiday. Mohamed Lahouaiej-Bouhlel, 31, smashed a 19-tonne truck into a packed crowd of people in the Riviera city celebrating Bastille Day Valery Hache/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Police work at a site where a Syrian migrant set off an explosive device in Ansbach, southern Germany, on 25 July, killing himself and wounding a dozen others Daniel Roland/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis A Syrian migrant set off an explosion at a bar in southern Germany that killed himself and wounded a dozen others in the third attack to hit Bavaria in a week. The 27-year-old, who had spent a stint in a psychiatric facility, had intended to target a music festival in the city of Ansbach but was turned away because he did not have a ticket Friebe/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Police officers walk along train tracks in Wuerzburg southern Germany on 19 July, a day after a man attacked train passengers with an axe. German authorities said they had found a hand-painted IS flag among the belongings of the man, an asylum seeker from Afghanistan, who seriously injured four members of a family of tourists from Hong Kong in his rampage Daniel Roland/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis German police killed a teenage assailant after he attacked passengers on a train in Wuerzburg, southerg Germany with an axe and a knife on 18 July, seriously wounding three people Karl-Josef Hildenbrand/AFP/Getty Images

The Paris public prosecutor's office said the incident was being investigated as an "attempted assassination connected with a terrorist enterprise and association with terrorist criminals".

The British government amended its travel advice in light of the attack but Downing Street said no UK nationals were affected.

“The Foreign Office has been liaising with their counterparts in France," Theresa May's spokesman said. "We are ready to assist if required."

Official travel advice urges British visitors to Paris to "exercise caution, avoid the affected area and follow the advice of local authorities" due to the continuing threat.

Police union official Yves Lefebvre said the man was carrying two backpacks and two machetes, and launched an attack when soldiers told the man he could not enter with his bags.

An American tourist visiting Le Louvre described how sirens sounded before emergency escape doors lifted from the ground.

“Four armed guards then sprinted around the grounds outside of the pyramid entrance looking for something,” he wrote on Twitter.

Another man, Olivier Majewski, was leaving his scooter in the parking area beneath Le Louvre when he saw a crush of around 30 people running and screaming “there's been a terror attack”.

French police secure the site near the Louvre Pyramid in Paris (Reuters)

The 53-year-old said he hid for about 15 minutes before making his way upstairs. He said people were clearly scared, adding: “They were panicked.”

Hundreds of people were evacuated from Le Louvre art gallery, Carrousel du Loure shopping centre, nearby Palais Royal metro station and surrounding gardens.

Around 250 people inside the museum were being held in "safe areas" by police, who moved tourists away from windows and pulled down the shutters as operations continued.

They have since been evacuated and the area has been reopened to the public, with surrounding roadblocks lifted. The museum is expected to reopen on Saturday.

It came following a series of Isis-inspired terror attacks in France, with the group calling on its followers to attack "infidels" and members of the security services.

The group massacred 130 people in a series of shootings and bombings in November 2015, and its followers have killed shoppers at a Kosher supermarket, a police officer and his wife and a Catholic priest.

More than 3,500 soldiers are currently patrolling Paris as part of increased security measures under the ongoing state of emergency, which has sparked human rights concerns.