Paul Donnachie, a St Andrews student and member of the Scottish Palestine Solidarity Campaign, has been found guilty of committing a racially aggravated act involving the flag of Israel.
Mr Donnachie was accused of putting his hands down his trousers and then rubbing them on the flag, which belonged to Jewish student Chanan Reitblat, who was studying at the Scottish university on an exchange programme from New York.
His friend Samuel Colchester was also accused of the act, but the case against him was not proven.
Mr Reitblat claimed that he was left feeling "violated and devastated" by the incident, which Mr Donnachie claims was one of political protest.
Mr Donnachie, who on seeing the flag described it as a terrorist symbol for a terrorist state, claimed that he had not meant to cause offence and said that he found racism "abhorrent".
Sheriff Charlie Macnair upheld Mr Reitblat's complaint saying: "This flag was his personal property. I consider that your behaviour did evince malice towards Mr Reitblat because of his presumed membership of Israel.
"I'm satisfied that you said Israel was a terrorist state and the flag was a terrorist symbol and I also hold that you said that Mr Reitblat was a terrorist."
Speaking of the ruling, Mr Donnachie announced his intention to appeal saying: "This is a ridiculous conviction. I'm a member of anti-racism campaigns, and I am devastated that as someone who has fought against racism I have been tarnished in this way."
Supporters of the Scottish Palestine Solidarity Campaign booed the sheriff and Mr Reitblat, and described the ruling as "scandalous".
St Andrews University said that it "abhors racial intolerance". Their spokesman said of their students: "Mr Donnachie was informed this afternoon that his studies at St Andrews have been terminated and he will leave the university with immediate effect.
"Mr Colchester has been informed that he has been suspended for one year and excluded from university halls of residence. Any further misconduct on his part will lead to automatic termination of studies."
Mr Donnachie's sentencing is pending background reports.
Read more on the story (BBC)
Read about racial hate crime (FindLaw)
Find local specialist solicitors throughout the UK (FindLaw)