A Brooklyn father is going to prison after admitting Friday to getting off a Long Island Rail Road train at Hicksville in the middle of the night, leaving his 3-year-old son and 14-month-old daughter on board.

Gerard Hatch, 48, pleaded guilty to one count of endangering the welfare of a child. District Court Judge David McAndrews sentenced him to five months in prison.

Hatch appeared intoxicated to witnesses and police, prosecutors said.

His children were not harmed in the April 20 incident, which happened shortly before 4:30 a.m.

Prosecutors said Hatch has an extensive criminal record, and has served jail time for criminal contempt, third-degree assault, disorderly conduct and other crimes.

He was represented by the Nassau County Legal Aid Society, which does not comment on individual cases.

Get the latest news and more great videos at NewsdayTV Credit: Newsday

When Springsteen brought 'Santa' to LI ... 100th birthday for Purple Heart, Bronze Star recipient ... Get the latest news and more great videos at NewsdayTV

Get the latest news and more great videos at NewsdayTV Credit: Newsday

When Springsteen brought 'Santa' to LI ... 100th birthday for Purple Heart, Bronze Star recipient ... Get the latest news and more great videos at NewsdayTV

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME