PARIS (Reuters) - A man who attacked soldiers with machetes at the Louvre museum in Paris has told police he identifies with the beliefs of Islamic State but said he did not carry out the attack on orders from the militant group, a judicial source said on Wednesday.

Egyptian Abdullah Reda al-Hamahmy, 29, was shot and seriously wounded when he launched himself at a group of soldiers on Feb. 3, crying out “Allahu Akbar” (God is greatest) in what French President Francois Hollande described as a terrorist attack.

Hamahmy, who was carrying spray paints in his backpack, has told police he wanted to damage paintings at the museum to “avenge the Syrian people”, a source said.

Hundreds of thousands of people have been killed and millions displaced in the conflict in Syria.

Hamahmy has been in hospital since the attack and late on Tuesday his police custody was lifted as his health had “greatly deteriorated”.

A source close to the investigation said that though he sympathized with Islamic State, Hamahmy said he had not been given instructions by the group and had not formally sworn allegiance to it.

He is being held on suspicion of seeking to carry out terrorist acts and involvement in criminal terrorist conspiracy and a formal investigation would begin once his health allowed.

The source said the suspect had made two money transfers of 3,000 and 2,000 euros to a fellow Egyptian in Poland in the days immediately before the attack.

France, which is preparing for a presidential election in April and May, remains under a state of emergency following a series of attacks by militant Islamists over the past two years in which more than 230 people have been killed.