NEW YORK (CBSNewYork) – More than 20 people were injured – two critically – when flames ripped through an Upper East Side apartment building overnight.

The fire broke out shortly after 2 a.m. at a 41-story high-rise on 72nd Street near York Avenue.

READ MORE: Anti-Violence Advocates Rally In Harlem Following Death Of 10-Year-Old Boy On Saturday

Many people sleeping inside were rattled out of bed.

“My wife and I heard like a lot of noise, crashing of glass,” resident James Gerard said. “My wife immediately smelled the smoke and said, ‘let’s get the heck out of here.'”

“The dog was barking, and I woke up and I went right to the door, and then we realized there was a serious fire. So we went to the balcony,” another resident added.

The fire broke out in a unit on the 24th floor. Fire officials say the couple living inside ran out of their apartment, the door not closing behind them. They collapsed in the hallway as heavy smoke and flames spread beyond their home.

“The door [being] open is what changed this fire completely. It turned a kitchen fire – a one-room kitchen fire – into a fire that spread throughout the upper floors of the building,” FDNY Deputy Assistant Chief Joseph Ferrante said on the scene. “Had the door been closed, this would have been one apartment, one room fire.”

Firefighters say it’s the same reason why fire quickly spread in a Bath Beach, Brooklyn, apartment building fire on Monday and why fire devoured a Bronx apartment building in December 2017, killing 13 people just three days after Christmas.

FDNY Urges People To Close Doors During Building Fires

“It’s a message that we repeat over and over and over. Close the door. Close the door. Close the door,” FDNY Commissioner Daniel Nigro said.

READ MORE: NYPD: 28-Year-Old Woman Shot To Death Outside Catering Hall In Cypress Hills, Brooklyn

Nigro says it’s a critical message worth repeating.

“If you live in an apartment in New York City, with rare exceptions, that door should close by itself. If it does not, notify building management and have it corrected immediately,” he said.

The FDNY says in this week’s fire, it’s unclear if the tenants disabled their front doors or if something was obstructing them.

Neighbors told CBS2’s Reena Roy it was a married couple that lived in the unit where the fire started.

“There was a ton of smoke in the hallway, there was black smoke everywhere,” one resident said. “It was hard to breathe.”

“I’m really hoping for their safe return and recovery,” he added. “Very nice people.”

Twenty other people – including a 1-week-old boy and four firefighters – were taken to area hospitals. Two of them had serious injuries, but the rest were minor.

“My son called me at 2:15 in the morning to tell me that there was an apartment on fire,” said the little boy’s grandmother, Debbie Waters. “It was coming up so much, and he has a one-week old baby.”

MORE NEWS: CBS2 Weather Headlines: Clear, Cold Overnight; Slightly Warmer Monday; Bigger Boost Tuesday

The couple who lived in the unit where the fire started remain in critical condition. The cause is still under investigation.