Five people have been charged after police were hit by eggs and stones during a mob gathering on a street in Levenmouth in Fife.
Officers were called after the group of up to 100 people targeted a house on Pirnie Street, Methilhill, at about 16:40 on Sunday.
Video posted on social media showed crowds chanting and beeping car horns while police stood guard outside the property.
Three men aged 22, 38 and 47 were arrested and charged over the disorder. A 36-year-old woman and a 15-year-old girl were also charged with vandalising property.
Police Scotland said officers were joined by specially trained public order officers after the crowd became abusive.
Social media footage showed police tackling members of the group and telling them to stay back from the house.
Ch Supt Derek McEwan said: "Violence towards officers while carrying out their duties will not be tolerated.
"Police officers are also members of the community and it is fortunate someone was not seriously injured.
"We understand there are strong feelings in the local area but that is no excuse for violence or disorder. We are particularly concerned with the number of children present."
He said officers would continue to review footage of the event to identify those involved.
The five people charged were released to appear in court at a later date.