A new law has increased the penalties for assault of transit workers.

Gov. Andrew Cuomo signed legislation Friday to elevate the crime from a misdemeanor to a Class D felony charge that can carry as many as seven years in prison.

“These workers perform tasks that are vital to the operation of New York institutions and have increasingly become the targets of aggression and assaults,” Cuomo said in a statement. “Signing these measures into law will help better protect these employees from harm and I thank the sponsors for their work to get them passed.”

The law extends the punishment already in place for assaulting train and bus operators to cover transit employees like subway and station cleaners—a win for workers who have advocated for stiffer penalties after a rash of attacks.

“Subway cleaners have been the victims of unprovoked, unwarranted and unacceptable attacks while working among the 6 million daily riders,” said John Samuelsen, TWU Local 100 president, in a statement. “This bill, which we fought long and hard for, gives them protection.”