The wave of killings on the outskirts of a university town began on Sunday and continued into Monday in Campinas, a city of one million people known as the hub of Brazil's tech industry.
The mostly drive-by shootings of the young men occurred within about four hours of one another and came after an off-duty police officer was killed while fighting armed robbers who targeted him as he stopped at a petrol station in the same region.
Police investigator Licurgo Nunes Costa said: "We are not ruling out executions, revenge nor a fight between criminals.
"It's a sequence of events in the same region and around the same time and we have to consider the relationship between the occurrences."
About 30 people protested over the killings, attacking commuter buses and burning at least three of them. There were no reported injuries.