Hold on to your butts!

A cigarette-smoking, drunk maniac snarled the Monday-morning commute when he ducked under a B train as it pulled into Grand Street Station — and survived with his smoke still alight.

“Right before the train hit him, he ducked under the platform. Everyone turned away, thinking he was dead — it was terrible,” said Little Italy resident Shon Mogharabi, 31, who captured astounding footage of the incident on his phone.

“Then he waved his hand from between the train and the platform and we were all shocked.”

Mogharabi says the man — 52-year-old Rafael Gonzalez, according to police sources — had been walking around the tracks before the B train pulled in around 10:15 a.m. while straphangers were trying to coax him off the rails.

When the telltale lights of an incoming train appeared in the tunnel, a woman successfully flagged down the driver to stop while Mogharabi tried to haul Gonzalez out of harm’s way — but the bald bozo just turned his back on the vehicle chugging toward him before ducking out of sight.

“I can’t believe he didn’t get hit, and I can’t believe that I was the only one who tried to grab him,” Mogharabi said. “He looked like he knew what he was doing, like he does this all the time.”

Mogharabi’s video shows the moment after onlookers breathed a collective sigh of relief — as Gonzalez’s cigarette-holding hand emerged from between the front car and the platform.

The man then tries to wave the train along, still clutching his cancer stick, before brazenly stubbing out the cigarette on the side of the carriage, the footage shows.

Commuters eventually convinced Gonzalez to come out from under the carriage and climb back onto the platform to safety — but not before he hurled a bottle from the tracks at the train.

The footage shows Gonzalez then try to stroll casually past firefighters who had come to rescue him — only to be foiled by passengers pointing out that he was the person they were looking for.

So Gonzalez danced a jig for New York’s Bravest before thrusting his groin against the train.

Cops finally escorted him off the platform and took him to Bellevue Hospital, according to police.

Gonzalez has a lengthy police record, with 19 arrests including multiple counts of assault as well as a criminal sex act, burglary and public alcohol consumption — in addition to multiple summonses for violations including urinating in public and turnstile jumping.

He wasn’t arrested for Monday’s incident, but straphangers were punished for his actions — B and D train service had to be rerouted for the next half-hour, according to the MTA.

Additional reporting by Stephanie Pagones