New legislation passed in the state Senate is making it a felony to harass a police officer.

The bill creates the crime of aggravated harassment of a police of peace officer, and can be used when a person harasses, annoys or threatens a police officer while on duty.

If convicted, the charge could result in up to four years in prison.

Senator Joe Griffo, who sponsored the bill, says the current laws " are way too low for the offender and it sends the wrong message to the public."

Griffo cited an incident in 2008 as the impetus behind the bill, but also pointed to a Utica traffic stop in 2012, where a police officer was assaulted.

The legislation is now in the Assembly, with sponsorship from Assemblyman Bill Magee. It has already passed the state Senate in three consecutive years.

More From WIBX 950