The NYPD has arrested a man suspected of fatally stabbing two homeless people on the A line and seriously wounding two others during a spree of unprovoked violence that began Friday morning and continued into early Saturday morning.

Rigoberto Lopez, 21, was taken into custody on Saturday night and has been charged with two counts of murder and two counts of attempted murder. Lopez's address, provided by the NYPD, is a homeless shelter located in the Red Lion Inn on Butler Street in Boerum Hill.

Lopez's victims were all reportedly homeless. The bodies of the two murder victims were found at opposite ends of the A line -- the first at the Mott Avenue-Beach 22nd Street station in Far Rockaway, Queens, where a man was found fatally stabbed on a subway bench around 11:20 p.m. on Friday. Approximately two hours later, a 44-year-old woman was found dead with stab wounds on a train at the Inwood-207th Street terminal.

The first known stabbing victim in Lopez's alleged spree was attacked on Friday morning, when a 67-year-old man was stabbed inside the Fort Washington-181st Street subway station. The victim survived the attack and was treated at a local hospital. The fourth reported victim was stabbed in the back at the same station around 1:15 a.m. on Saturday. That 43-year-old man was hospitalized in stable condition.

With a suspected serial killer at large, the NYPD flooded the subway system with 500 additional officers, assigning at least one officer to each of NYC's 472 subway stations on Saturday and Sunday. At a press conference on Saturday, NYPD Commissioner Dermot Shea told reporters "there is a small army of detectives and investigators working this all night, throughout New York City."

An NYPD spokesperson said on Sunday that Lopez was taken into custody in the 34th Precinct, which includes Inwood and the subway station where the last stabbings occurred. No additional details were immediately available about the arrest, but police sources told the NY Post the suspect had blood stains on his sneakers.

The NYPD tweeted a photo of a knife that was allegedly in Lopez's possession at the time of his arrest:

Police sources told the Daily News that Lopez is mentally ill and has been arrested four times, including a felony assault arrest in January.