PROVIDENCE, R.I. — Rhode Island’s largest city has enacted a sweeping police accountability measure, which proponents say could be a national model for ending discriminatory profiling by race, gender identity, immigration status and other factors.

Providence Mayor Jorge Elorza (HOR’-hay ay-LOR’-sah), a Democrat, signed the ordinance into law Thursday. It takes effect in January.

Elorza says it’s the “most comprehensive community-police relations law in the country.”

The all-Democrat city council approved it earlier this month after years of debate and community activism. The measure had stalled in April after the police union called it a “slap in the face.”

Some minor changes were made to reflect police officers’ concerns. The union remained opposed.

The wide-ranging law mandates policies for traffic stops and police body cameras and reforms the police department’s gang database.