You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Rigoberto Lopez is charged with one count of first-degree murder, two counts of second-degree murder, and two counts of second-degree attempted murder, the New York Police Department said on Twitter.
The four unprovoked attacks apparently targeted homeless people and took place on the A train or at stations served by it beginning on Friday morning.
Local radio station 1010WINS, citing police sources, said Lopez was taken into custody late on Saturday wearing blood-soaked clothes and shoes.
In the first attack, a 67-year-old man is recovering in the hospital after being stabbed by a masked assailant at the West 181st Street station in upper Manhattan, police said.
Hours later, a man was found stabbed to death on an A train at Far Rockaway-Mott Avenue station in Queens.
Soon afterward, a 44-year-old woman was discovered unconscious with stab wounds on an A train at the 207th Street station in Manhattan. She was pronounced dead at a hospital.
The fourth person was a 43-year-old man who was stabbed early on Saturday, also at the West 181st Street station. After undergoing surgery, he was in a stable condition, police said.
New York City Police Commissioner Dermot Shea told reporters on Saturday that 500 additional officers were being deployed to the city's transit system "to make sure people feel safe."