Three people were killed early Monday in a fire that tore through an apartment building in Upper Manhattan with a recent history of over 100 code violations, the authorities said.

Fourteen other people were injured, five of them severely, in the blaze at 207 Dyckman Street in Inwood, according to the Fire Department.

None of the deceased victims have been identified. The Fire Department said it received a call at 12:35 a.m. about a fire on the second floor of the six-story building. The first trucks arrived three minutes later and began rescuing residents on the building’s fire escapes as the fire stretched from a first-floor hallway to the bulkhead on the roof. Officials said the fire was under control at 3 a.m.

Alexis Rodriguez said he was at work when the fire broke out. But his wife and their three children — ages 4, 8 and 18 — were home in their apartment on the sixth floor. Now, they are in critical condition in the hospital.

“They’re intubated right now,” he said in Spanish as a neighbor translated.

“I’m praying,” he added. “I don’t know what happened. I don’t know how it happened. I wasn’t there. I wish that I was there.”

Fire Commissioner Lillian Bonsignore said the fire had been able to spread more quickly because fleeing residents had left their apartment doors open.

“I know it’s a scary situation in a fire,” she said at a news conference. “We’re not always thinking straight. But close the door. Make sure all your family members know to do the same.”

Eight apartments were heavily damaged in the fire, and more than 100 people have been displaced, officials said. About 190 firefighters and emergency medical workers responded to the scene.

The cause of the fire was not known. Officials said the fire marshal was investigating.

The building, which according to city records has 23 apartments, was constructed in 1910. City records show it had so many housing code violations that it was put into a special program to correct safety issues, known as the Alternative Enforcement Program. A report sent by the Department of Housing Preservation and Development to the City Council in March said the building had almost 150 hazardous violations.

The housing department’s database on Monday showed more than 100 violations, including 15 issued this year about leaky pipes, a failure to provide heat in one apartment and a host of other issues. Some of the violations were connected to fire safety issues, including faulty self-closing doors, which are designed to prevent fire and smoke from spreading. The violations also included a lack of adequate electricity in one apartment.

The housing department said in an email on Monday that 85 violations had recently been resolved.

Attempts to reach the landlord by phone and email on Monday were not immediately successful.

The same landlord, an entity called SB Dyckman LLC, was sued just last Monday by the city over conditions in the adjoining building next door at 209 Dyckman Street. The suit, brought by the housing department, accuses SB Dyckman and its principals of waging “an intentional and aggressive campaign to harass and displace rent-stabilized tenants.” It states that 209 Dyckman had 219 open code violations, including 58 “immediately hazardous” ones.

So far this year, 36 people have died in fires in New York City, including Monday’s deaths, officials said.

On Monday afternoon, broken windows revealed the charred remains of some apartments. Tenants lingered on the sidewalk and at a restaurant across the street as workers from the Red Cross assisted them. Shards of glass glittered in the sunlight as local elected officials held a news conference.

Juan Carlos Murray, 43, said he awoke to find a young woman outside his window on the fire escape. She had been burned and was struggling to breathe, he said. He wrapped her in his coat as she begged him to help save her father.

“Don’t let him die,” he recalled her pleading.

But when they crawled through her window, they could not find her father. Firefighters soon arrived and carried the woman out on a stretcher, he said. Outside, he saw another man on a stretcher, his face unrecognizable.

Rita Vega, 35, said she was startled awake by the blaring of fire alarms and a neighbor shouting, “Fire!” She and her parents fled by climbing down the front fire escape.

They had tried to leave through their apartment’s front door, she said, but when her father opened it, he was met with a wall of flames.

Ms. Vega said that many of the tenants were older people. The fire escapes at the back of the building are also darker and more difficult to navigate, she said.

The apartments are rent-stabilized and “a lifeline for this community, for people who are trying to afford rent here,” she added.

“They have lived there their whole life, their children,” she said. “And so it’s really gut-wrenching to experience this level of trauma.”

Mihir Zaveri and Andy Newman contributed reporting.