A 19-year-old man was sentenced to five-and-a-half years in prison on Tuesday for setting a man on fire while riding the subway last December.

Hiram Carrero, who was 18 at the time of the incident, had previously pleaded guilty to federal charges of arson. Prosecutors say Carrero entered the subway last December, set fire to a piece of paper and left it next to a sleeping man before getting off the train.

In a letter to Judge Lewis Liman ahead of the hearing, federal prosecutors asked him to follow sentencing guidelines for attempted murder of 78 to 97 months, arguing that Carrero’s conduct — moving the paper across the train to where the victim was and trapping him on the moving train — showed intent to kill.

But Carrero’s attorney, Jennifer L. Brown of the Federal Defenders of New York, asked for leniency. Brown argued the evidence didn't establish an intent to kill because Carrero didn’t use accelerant, didn’t wait to confirm the fire took hold and didn't flee the station. She asked for 60 months, the mandatory minimum.

In her letter, she also painted a broader picture of Carrero’s life, including saying he suffered medical and neurodevelopmental impairments due to exposure to drugs in utero and being born prematurely.

“The circumstances of his birth resulted in neurodevelopmental challenges that have shaped Hiram’s young life,” she said. “He is only beginning to understand himself and how his history, previously unknown to him, may have contributed to his offense.”

In a letter to Judge Lewis Liman, Carrero expressed remorse and shame for his actions and his desire to “do better.”

“If I could talk to the person I hurt directly, to the victim of my crime, I would say, I strongly apologize for my actions,” he said. “I hope that you are doing better and healing. When I think about what it must have been like for you, I tear up.”

The subway attack came about a year after another man, Sebastian Zapeta, allegedly ignited a subway rider’s clothing and watched her burn to death at a Coney Island station.

Brooklyn prosecutors charged the defendant with first-degree murder, second-degree murder and arson. Those charges are still pending.