A mugger who hit two New York City subway riders on the head with a hammer has been sentenced to 12 years in prison.

Brooklyn District Attorney Ken Thompson says Anthony Coward was sentenced Monday.

The May 2014 attacks occurred in the Rockaway Avenue station in Bedford-Stuyvesant. The victims were ambushed from behind while they were buying fare cards.

Coward stole $58 from one victim and $140 from the other. Prosecutors say he continued to hit one victim after he fell to the ground.

He pleaded guilty on Jan. 25 to two counts of first-degree robbery.