Police Community Support Officer Joe Gatenby said it happened after he got hold of the bike in Girlington, Bradford.
Describing the attack on Twitter, he said: "Unfortunately they weren't too happy about it and I was bricked and set upon by a large group."
PCSO Gatenby called his colleagues for back up. He added: "One bike recovered and one in custody. Result."