Officers at the fair, located at the Sonoma County Fairground in Santa Rosa, received a report around 8:40 p.m. of a stabbing in the carnival area.
The officers found the 13-year-old boy suffering at least one non-life threatening stab wound, police said.
Detectives determined that the victim and his friend, another Santa Rosa juvenile, are both alleged gang associates. Police said the boys were confronted by a group of rival gang members who challenged the boys to a fight.
According to police, the group attacked the victims while yelling gang names and epithets before fleeing. The 13-year-old was transported to an area hospital.
Anyone with information about the stabbing is urged to call Detective John Cregan at (707) 543-3670.