(CNN) California Governor Gavin Newsom did away Wednesday with a law that made it a crime to refuse to help a police officer.

The law dates back nearly 150 years to California's Wild West days, when cowboys and outlaws roamed the state.

The California Posse Comitatus Act of 1872 made it a misdemeanor for "an able-bodied person 18 years of age or older" to refuse a request for assistance from a police officer "in making an arrest, retaking into custody a person who has escaped from arrest or imprisonment, or preventing a breach of the peace or the commission of any criminal offense."

It was widely used by authorities to legally form posses to hunt outlaws.

State Senate Bill 192, which repeals the law, was first introduced on January 30, and it was sponsored by Senator Bob Hertzberg. Hertzberg originally tasked his interns with identifying outdated laws when they discovered it.

Read More