© Santos / News
Maksim Gelman, 23, was taken into custody at the Times Square subway station, police said. It was unclear if he was injured.

The knife-wielding madman who killed four people during a day-long rampage of stabbings, carjackings and hit-and-runs was nabbed in Times Square moments after he knifed a straphanger.

"They had to die," Maksim Gelman, 23, confessed after being tackled by two transit cops and an off-duty detective about 9 a.m. yesterday, sources said.

His arrest ended a one-man wave of breathless violence that spanned nearly 28 hours and two boroughs, fueled by rage at ex-flame and murder victim Yelena Bulchenko.

Gelman, described as a druggie graffiti vandal, lashed out at innocent bystanders as he cut a bloody swath through the city with six knives - sparking a massive manhunt.

"I don't recall ever seeing anything like this," said Police Commissioner Raymond Kelly. "He certainly did a lot of mayhem and havoc in a short time."

The frenzy finally came to an end after Gelman wildly hacked at a man on an uptown No. 3 train leaving Penn Station for 42nd St., sending screaming passengers running to safety.

© Facebook
Yelena Bulchenko (right), 20, and her mother, Anna.
"I looked inside and saw a bunch of people running toward me," said John Bodensiek, 53, who was on the train. "There was panic. People were running and saying, 'Move! Move! Move!'"

Gelman pounded on the motorman's compartment, screaming "Police! Police!"

Instead of the motorman, transit cops Terrance Howell and Tamara Taylor stepped out, and Howell wrestled Gelman to the ground as he reached for a knife.

Off-duty detective Marcelo Razzo ran from the third car and helped subdue the suspect, who had ditched four knives in a getaway car but still had two.

Transit cops were on high alert after reports that Gelman was spotted on a No. 1 train traveling south from 137th St., Kelly said.

"Do you believe what they're saying about me?" Gelman said as he knocked a newspaper bearing his photo out of a woman's hand, Kelly said.

Investigators believe Gelman stepped off at 34th St. and crossed on the tracks to an uptown No. 3. He walked to the front car, wailed about his dead ex-girlfriend and randomly slashed rider Joseph Lozito, 40.

"[Gelman] said, 'You're going to die,'" Lozito's sister, a city cop, said at Bellevue Hospital, where her brother was in stable condition.

"He tried to get to the conductor. He couldn't, so he just turned around looking for the next person - that was my brother."

As the train screeched to a halt before Times Square, a wave of cops got on and rushed toward the first car to haul out Gelman.

Gelman - who sources said appeared to be on drugs - dropped a blood-stained 10-inch knife in the struggle.

© Santos / News
Joseph Lozito was slashed several times during the attack.
He was taken to the 61st Precinct stationhouse, where cops asked him why so many people were killed or hurt.

"Why?! Because I say so!" he said, according to a law-enforcement source.

"His explanation, if you can call it that, is 'These people have to die, they had to die, that was their destination,'" the source said.

The protracted bloodbath began 5 a.m. Friday at Gelman's home over a seemingly trivial matter - use of his stepdad's Lexus.

The suspect - who had 10 prior arrests, but none for violent felonies - fatally stabbed his stepfather, Aleksandr Kuznetsov, 54. Then he took the Lexus, raced away from the E. 27th St. apartment, and ran over a crossing guard, breaking her leg.

Gelman next surfaced at 10 a.m. to kill Anna Bulchenko, 54, the mother of his ex-girlfriend Yelena, cops said.

He waited for more than six hours until the beautiful brunette returned home, Kelly said. When Yelena saw her mother's body, she called 911 and tried to flee - but the killer chased her down and stabbed her a dozen times.

Gelman tried to escape in the Lexus but rear-ended a Pontiac Bonneville driven by 60-year-old Art DiCrescento - who quickly became the psycho's next target.

Gelman stabbed DiCrescento several times, stole his car, and a mile later struck and killed pedestrian Steve Tannenbaum, 60. After ditching the Pontiac in Flatbush, Gelman hailed a livery cab in Bedford-Stuyvesant and put his blade up to driver Fitz Fullerton's throat. Fullerton, 55, fought back and the car slammed into a parked vehicle.

Gelman hopped out of the cab and set his sights on Sheldon Pottinger, 25, in a Nissan Maxima on Eastern Parkway.

Snarling "Motherf-----, get out of the car," Gelman slashed Pottinger, who tumbled out as the car peeled away. The car was found abandoned on 76th St. in Queens hours later.

Alison Gendar, Bob Kappstatter and Jonathan Lemire contributed to this article.