Sleeping with the door closed helps save lives -- especially those of children --  in case of fire, a firefighter in New York recently explained.

The firefighter, identified by Sky News as James Felton with the Cold Spring Harbor Fire Department,  took to the fire department’s Facebook page in late January to share pictures of the inside and outside of a bedroom door following a fire.

HERO DOG IN NEW YORK ‘SNIFFS OUT DANGER,’ SAVES FAMILY FROM GAS LEAK

“As a parent, it’s hard to convince little kids to sleep with the door closed, they always want it open just a little. I do a lot of fire prevention at schools, so one thing I try and stress to the kids is, how important it is to sleep with the doors closed,” Felton began, before detailing a recent fire at a home in the nearby New Fairfield.

One photo shows the blackened outside of the bedroom door, which faced the hallway. The other shows the side that faced the inside of the bedroom.

“The photos below are a great example of the importance of keeping bedroom doors closed while sleeping. The door pictured in both photos is a hollow core door to a bedroom. While the front of the door is severely damaged the closed door protected the bedroom and its contents,” the post reads. “If this were an occupied bedroom the closed door could have saved a life."

“I close my door so the ghosts don't come in my room but glad to know there are other benefits!” one person joked in response.

SINGER HORRIFIED AS HER DOG IS MAULED TO DEATH IN FRONT OF HER

“We have always closed the doors at bedtime,” another wrote.

“I close my door in case of intruders but now BC of this. I never knew this till now,” a third commented.

As of Saturday afternoon, the post had nearly 7,000 shares and 2,000 reactions.