An FDNY firefighter went berserk, breaking into his ex-girlfriend’s home, holding her and her five-year-old daughter captive while he threatened to behead the child and shoot them both, the Post has learned.

The 12-year-veteran Tom Taps, 42, locked the 39-year-old victim and her child inside her Staten Island home late Thursday and they were not able to escape his wrath until nearly 5 a.m. Friday, sources said.

“I have f—–g guns. I will shoot you in your beautiful face and shoot your retarded daughter in the face,” the 6-foot-5, 220-pound smoke eater said according to sources said.

He allegedly then pinned the woman to the bed and threatened, “If your foot hits the floor, I’m going to chop (the girl’s) head off. We’re on lockdown all weekend.”

Taps was arrested Friday and charged with burglary, unlawful imprisonment, harassment, assault, obstruction of breathing and endangering the welfare of a child, a criminal court complaint charges.

The firefighter has been suspended without pay, for a maximum of 30 days while the incident is under investigation, sources said.