A 12-year-old boy is facing attempted murder charges for a sickening Brooklyn subway pummeling that nearly killed a straphanger. 

The pint-sized suspect – whose name is being withheld because of his age – was arrested around 12:45 p.m. Friday at the corner of Surf and Stillwell avenues in Coney Island.

He also was slapped with three counts of assault after he and another boy allegedly unleashed a beatdown on a 42-year-old man who was riding a D train near the Fort Hamilton Parkway station in Borough Park at 9:20 p.m. Wednesday, according to police.

Surveillance photo of the 12-year-old suspect sought in a Brooklyn subway beating.Police said a 42-year-old man was attacked on a D train in Brooklyn. DCPI

Police sources initially said the victim had asked the “disorderly” boys to keep the noise down, but later indicated the attackers had simply randomly targeted him.

One of the boys did a flip in front of the victim, and the other knocked his hat off, leading the man to push him away before exiting the train, according to police sources.

Once on the platform, the brutes allegedly punched the victim repeatedly in his face and body – and once on the ground, they allegedly stomped on his head, leaving him battered and bleeding, cops and police sources said.

Medics rushed the badly beaten victim to Maimonides Medical Center in critical condition with severe head trauma and deep gashes across his face.

He has swelling to the brain, but has been upgraded to critical but stable condition, police and sources said.

A D-line subway train arrives at the Broadway-Lafayette Street station in New York.The beatdown happened on a D train in Brooklyn after the man asked the kids to keep the noise level under control, police sources have said. Getty Images

NYPD sleuths were still on the hunt for the second suspect and released surveillance video — showing him walking inside a subway station with other boys — in the hopes of tracking him down.

Anyone with information is urged to call Crime Stoppers at 1-800-577-TIPS (or 1-888-57-PISTA for Spanish), log onto the Crime Stoppers website, or message @NYPDTips on X. All calls are strictly confidential.