SACRAMENTO, Calif. – Gov. Jerry Brown has approved legislation to change California’s definition of racial profiling and require local law enforcement agencies to collect demographic data on the people they stop, his office announced Saturday.

The law would give the public and police data to further gauge reports of racial profiling that have become a rallying cry of the Black Lives Matter movement following the deaths of unarmed black men during encounters with police, Assemblywoman Shirley Weber, D-San Diego, said of her bill.

Legislators in nearly every state this year proposed measures stemming from the Aug. 9 fatal shooting of Michael Brown, an unarmed black 18-year-old who had scuffled with a white officer in Ferguson, Missouri. Brown’s death triggered large protests and repeated clashes between demonstrators and heavily armored police.

Twenty-four states passed at least 40 new measures addressing such things as officer-worn cameras, training about racial bias, independent investigations when police use force and new limits on the flow of surplus military equipment to local law enforcement agencies, according to a recent analysis by The Associated Press.

Still, far more proposals have stalled or failed, and few states have done anything to change their laws on when police are justified to use deadly force.

In California, Weber’s measure was one of the few police reform bills to reach the governor’s desk. Hundreds of protesters rallied outside the governor’s Capitol office in early September to support the legislation, which requires local law enforcement agencies to collect the data and the state attorney general’s office to compile it.

Data already collected by the attorney general’s office recently showed that while just 6 percent of Californians are African American, they are involved in 17 percent of arrests and a quarter of deaths in custody. Young black men are 25 percent more likely to be booked into jail than whites.

Under Weber’s bill, agencies would have to include the race of the person who was stopped, the reason for the stop, and whether the stop resulted in a citation or arrest. The largest police departments will have to start reporting in April 2019 and the smallest by April 2023.

It also requires the attorney general to create an advisory board with the goal of eliminating racial and identity profiling and improving diversity and racial sensitivity among law enforcement.

Several Republicans opposed it, saying such record-keeping would require onerous, costly reports and might be unnecessary as police agencies begin using body cameras. They fear it could prompt officers to engage in racial profiling against whites to skew the statistics.

The total cost to state agencies and the California Highway Patrol for the extra reporting has been pegged at $9 million, but supporters argue that collecting such data ultimately could avoid costly financial settlements when police unlawfully kill people.

The governor also signed separate legislation by Sen. Jim Beall, D-San Jose. SB11 would require the state’s Commission on Peace Officer Standards and Training to increase training on mental health issues. It would mandate 15 hours in basic training courses for police recruits, with additional training for supervisors every four years.