The son of legendary Pink Floyd guitarist David Gilmour may face a jail sentence after pleading guilty to a charge of violent disorder during the student protests last year over rising school fees.

The charge could a penalty of up to five years in prison.

Charlie Gilmour, 21, did not plead guilty to a charge that he was among the demonstrators who attacked a vehicle carrying Prince Charles and his wife, Camilla.

Charlie was among thousands of students and union members who rallied at Trafalgar Square and Parliament Square in December of last year.

A student at The Girton College, Charlie was alleged to have smashed a store window during the march and also throwing a trash can at a royal convoy, which just missed striking Prince Charles’ car.

The former model was granted conditional bail until July so he can take his end-of-year exams at Cambridge University.

He is also banned from the City of Westminster.

However, the presiding judge Nicholas Price QC, warned young Gilmour: The fact that I am granting you bail is of no indication whatsoever that you will be dealt with in a non-custodial way. You must understand that your plea of guilty to violent disorder is a serious matter and it may be that the proper course would be one of immediate custody.

Gilmour was adopted by David Gilmour when the latter married journalist Polly Samson. Polly’s ex-husband, poet and playwright Heathcote Williams, is Charlie’s biological father.

During the demonstration, Charlie was photographed hanging from a flag on the Cenotaph. He later apologized for his action, claiming that he didn’t realize the monument honored British war dead.

I feel nothing but shame,” he said at the time. “My intention was not to attack or defile the Cenotaph. Running along with a crowd of people who had just been violently repelled by the police, I got caught up in the spirit of the moment.”