PROVIDENCE, R.I. — A Rhode Island lawmaker wants to bar a rare criminal defense allowing the use of a victim’s sexual orientation as justification for violent crime.

Democratic Rep. Kenneth Marshall has introduced a bill to restrict the use of a victim’s sexual orientation or gender as a defense by defendants claiming provocation, diminished capacity or self-defense. It would prohibit the court from allowing such information into evidence.

Marshall said Tuesday he got the idea from other states passing similar legislation.

Illinois began prohibiting defense attorneys from mounting the so-called “gay panic defense” this month. California prohibits it too.

Gay rights advocates have said the ban is needed because crimes against gay and transgender people are on the rise.

Some attorneys say it’s unnecessary because the old-fashioned defense wouldn’t hold up in court.