The US army has temporarily taken down its website after a hacking attack.

It says an element of the army.mil website was compromised and preventative measures had to be taken to ensure there was no breach of data.

The Syrian Electronic Army - which supports President Bashar al-Assad - says it was behind the attack.

Last week, the US said Chinese hackers had attacked federal government computers and may have compromised the records of four million employees.

China denied any involvement and called the allegations "not responsible, and counterproductive".

On Monday, US Brig Gen Malcolm Frost, the chief of the army public affairs, said "the army took appropriate preventive measures to ensure there was no breach of army data by taking down the website temporarily".

Screen grabs posted on social media earlier showed messages on the website.

One of them read: "Your commanders admit they are training the people they have sent you to die fighting."

The army.mil website is the shop front for the US military, and having to take it offline is embarrassing, the BBC's Gary O'Donoghue in Washington reports.

It comes just five months after US Central Command had to temporarily close its YouTube and Twitter accounts after what was described at the time as cyber vandalism - with pro-Islamic State messages being posted.

Earlier in the year, US President Barack Obama acknowledged that the nation and the economy faced enormous vulnerabilities from such attacks.