A New York firefighter was killed on Thursday night in a blaze at a building in Harlem that was being used as a set for Motherless Brooklyn, a film adaptation of Jonathan Lethem’s novel, directed by Edward Norton.

Michael Davidson was separated from other firefighters as conditions deteriorated and had lost consciousness when he was found. He was pronounced dead at a hospital.

“It’s an awful night,” said Eric Philips, a spokesman for Bill de Blasio, New York’s mayor. “You haven’t heard a scream until you’ve heard the scream of a mother who’s seen her son give his life to protect us.”

Two other firefighters suffered burns and were in serious condition and three others were injured, fire commissioner Daniel Nigro said, adding: “Our department and our entire city mourn this tragic loss of a very brave firefighter.”

Davidson was the son of a retired firefighter and had served for about 15 years. He leaves a wife, Eileen, daughters aged seven, three and one and a six-year-old son.

You haven’t heard a scream until you’ve heard the scream of a mother who’s seen her son give his life to protect us Spokesman for Mayor Bill de Blasio

Producers sent condolences to Davidson’s family of the firefighter, according to a statement given to TV station WABC. They said crews immediately called the fire department when they noticed smoke on the set.

“We watched firsthand with astonishment as they charged into the smoke to make sure all were safely out and then fought to contain the blaze and prevent it from spreading, putting their lives on the line as they do every day,” the statement read.

As darkness fell around 7pm, the scene around the old townhouse in the Sugar Hill neighborhood of West Harlem had been all bustle, as film crews supervised lights, cables and 1950s vintage cars.

Filming on Motherless Brooklyn, in which Norton is set to star alongside Bruce Willis, Willem Dafoe and Alec Baldwin, was going on inside what used to be St Nick’s Jazz Pub, a legendary Harlem venue that has been closed for several years but which locals have always hoped will re-open.

By midnight, as passersby emerged from the nearby 145th Street subway stop, flames were leaping 10ft from a third-floor window and the air was thick with smoke and sparks. Saint Nicholas Avenue was filled for blocks with fire trucks, emergency vehicles and emergency personnel.

The following morning, the neighborhood awoke to the stunning news of Davidson’s death. At the building, the sign erected for the film set, “The King Rooster, cocktails and jazz” was somehow undamaged. But the building was a shell, burned front to back and top to bottom, sky visible through burned-out windows and black smoke streaks on the brick. A lone fire truck from Hell’s Kitchen 21, further downtown, was on the scene. The fire was out.

A vintage car on the set. Photograph: William Volcov/REX/Shutterstock

It was not clear what caused the fire that ripped through the five-storey building.

“I’ve lived here all my life,” said Tony Lewis, 70, a retired law enforcement professional who was standing behind FDNY tape across the street. “I feel sorry for the firefighter’s family and from the people who’ve been displaced from the apartments above the club.

“I used to go there before it was even St Nick’s Pub, in the 60s when it was the Pink Angel. I’d stop by for a vodka and live music, then go about my business. Fire is the worst thing. I heard the firefighter went into the basement and they lost contact with him and when they found him he was dead. The building was very old. I wonder if there was faulty wiring.”

The scene of the fire in daylight. Photograph: Startraks Photo/REX/Shutterstock

Sugar Hill has become increasingly popular as a film set. Vintage cars were still parked on Friday morning. Jay Munroe, 32, a sales executive, said he moved to the neighborhood six years ago.

“I was talking to the owner of St Nick’s Pub just the other day and he was hoping to reopen the place, it’s such a landmark,” he said. “It could still happen, they could rebuild, Harlem needs a jazz club. He was also talking about the great opportunity of the film project and other projects like it.”

Another resident, 28-year-old Daquan Evans, told the New York Post: “That actor Ed Norton walked right by. He looked pretty upset. This is crazy, this fire. You think a movie comes up here and it is good for the neighborhood. Not a fire … damn.”