A student at St Andrews University has been found guilty of a racist breach of the peace after he insulted the flag of Israel.
Paul Donnachie, 19, put his hands down his trousers then rubbed them on a flag belonging to Jewish student Chanan Reitblat.
Donnachie also accused Mr Reitblat of being a terrorist during the incident at the halls of residence in March.
The case against his co-accused Samuel Colchester, 20, was found not proven.
Donnachie has been expelled from St Andrews and Mr Colchester has been suspended for one year.
Cupar Sheriff Court had earlier heard evidence from Mr Reitblat, a chemistry student on a one-term exchange from the Jewish Yeshiva University in New York, who said he felt "violated and devastated" by the incident.
The court heard that Donnachie and Mr Colchester entered the halls at 01:30 on 12 March to see another student who shared the flat.
Lithuanian-born Mr Reitblat said he had the 4ft by 3ft (1.2m by 0.9m) flag on the wall after being given it by his brother, an Israeli Defense Forces (IDF) soldier.
He said Donnachie noticed the flag, and said Israel was a terrorist state and the flag was a terrorist symbol.
He then unbuttoned his trousers, put his hands down his pants, pulled off a pubic hair and rubbed it over the flag.
Mr Reitblat said he then threw the pair out.
Sentencing Donnachie, a history student and member of the Scottish Palestine Solidarity Campaign, sheriff Charlie Macnair said: "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."
Sentence on Donnachie was deferred for background reports.
Members of the Scottish Palestine Solidarity Campaign, who packed the public benches in the courtroom, booed, tutted and shouted "scandalous" as the sheriff rose to leave.
Outside the court, a tearful Donnachie said he would appeal.
He said: "This is a ridiculous conviction. I'm a member of anti-racism campaigns, and I am devastated that as someone who was fought against racism I have been tarnished in this way."
Mr Reitblat, who was also booed as he left the court, said he "welcomed" the conviction.
St Andrew University conducted its own investigation into the incident back in June but reserved its findings to avoid prejudicing the court proceedings.
A spokesman for the university said it had a long tradition of tolerance, respect and the right to freedom of expression, but was also a community which "abhors racial intolerance".
He added: "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."