The bans follows incidents involving college students who had to be hospitalized after drinking too many of caffeinated alcoholic drinks.
Critics say the beverages target young people. The drinks typically come in large containers with high alcohol content, making it easy to drink too much, and in sweet, fruity flavors.
The bill's creator was Democratic State Sen. Alex Padilla of Los Angeles.
As a result of the bans, most manufacturers have changed their formulas to exclude caffeine.
The Associated Press contributed to this story.