During a day of riots he was seen hanging from a Union flag on the Cenotaph and leaping on to the bonnet of a Jaguar car that formed part of a royal convoy. He was found by a judge to have also hurled a rubbish bin at the vehicle.

The court heard the Cambridge University student had turned to drink and drugs after being rejected by his biological father, the writer Heathcote Williams, and had taken LSD and valium in the hours leading up to the violence.

Gilmour's rock star father and his mother Polly Samson watched from the public gallery as their 21-year-old son was told he must serve half the jail term behind bars.

Passing sentence at Kingston-upon-Thames Crown Court in Surrey, Judge Nicholas Price QC accepted that his antics at the Cenotaph on Whitehall did not form part of the violent disorder, but accused him of disrespect to the war dead.

"Such outrageous and deeply offensive behaviour gives a clear indication of how out of control you were that day," he said. "It caused public outrage and understandably so."

His conduct at the war memorial had prompted a deluge of "vituperative and in many cases obscene" emails and other forms of communication, he told Gilmour.

These were, he added, "not just to you but, it is with deep regret, to your whole family, who were of course totally blameless."

Gilmour, who apologised afterwards for his behaviour, had claimed he had not realised the significance of the Cenotaph - an excuse the judge scoffed at: "For a young man of your intelligence and education and background to profess to not know what the Cenotaph represents defies belief."