The California state Senate passed a bill that would limit the use of rap lyrics as evidence in criminal proceedings — a controversial and common practice by prosecutors that has garnered national attention amid the indictment against rappers Young Thug and Gunna.

Bill AB 2799, which is expected to be signed by Gov. Gavin Newsom after clearing the State Assembly, would be the first legislation of its kind to be signed into law.

According to the bill, the legislation seeks to “ensure that the use of an accused person’s creative expression will not be used to introduce stereotypes or activate bias against the defendant, nor as character or propensity evidence.”

Referencing the lyrics of hip-hop artists in criminal charges is not new and is a practice that has drawn criticism from both freedom-of-speech advocates and the musicians themselves, who argue that lyrics — often with no factual connection to a case — are not a true reflection of reality or the artists’ state of mind and serve to prejudice a jury against a defendant.

The bill, which was sponsored by Assembly Member Reggie Jones-Sawyer, would require a judge to determine the admissibility of the lyrics in question as evidence and whether they are directly linked to an alleged crime.

The controversial practice of using rap lyrics in court was thrust into the national spotlight earlier this year when rap lyrics were used as part of the alleged evidence in a grand jury indictment that led to the arrests of Young Thug and Gunna.

The hip-hop stars were charged with conspiring to violate the state’s Racketeer Influenced and Corrupt Organizations Act, according to charging documents obtained by ABC News.

They have pleaded not guilty and were denied bond; their trials are set for January 2023.

Copyright © 2022, ABC Audio. All rights reserved.