An 18-year-old Manhattan man was arrested Thursday, accused of setting a homeless subway rider on fire at Penn Station earlier this week, police said.

Hiram Carrero faces charges including attempted murder, assault, arson, criminal mischief and reckless endangerment, according to the NYPD. He was taken into custody around 10:45 a.m. near his home in Harlem.

The attack occurred around 3 a.m. Monday when the 56-year-old victim was sleeping on a northbound 3 train at the 34th Street-Penn Station stop in Midtown, officials said. Police said Carrero briefly stepped into the train car, lit the victim's pants on fire and walked back onto the platform before fleeing on another northbound 3 train.

First responders took the victim to Weill Cornell Medical Center, where he was treated for significant leg burns.

The NYPD released surveillance video on Tuesday showing a suspect leaving the 34th Street station and requested the public's help identifying him.

A law enforcement source said a tipster called police to help corroborate the investigation of Carrero.

The investigation was conducted by the arson explosive task force between the NYPD and the federal Department of Alcohol, Tobacco and Firearms, the source said.

Carrero has no prior arrests, according to police records. Attorney information was not immediately available.

The incident comes almost a year after 57-year-old Debrina Kawam, a homeless woman, was fatally set on fire aboard an F train in Brooklyn. That case led to murder and arson charges against 33-year-old Sebastian Zapeta, who pleaded not guilty in January.

This story has been updated with new information.