NEW YORK (AP) — A New York City firefighter died after he became separated from his unit as they battled a fierce, smoky blaze that broke out in the basement of a former Harlem jazz club being used as a film set.

The fire started as the crew of “Motherless Brooklyn,” directed by Edward Norton, was nearing the end of its working day at 11 p.m. Thursday. Flames poured out the windows as firefighters stormed into the five-story building, dumping water on the blaze to get it under control.

Firefighter Michael R. Davidson of Engine Company 69 was assigned to the nozzle on the lead hose-line. He got separated from other firefighters inside the building as conditions deteriorated, fire officials said, and had lost consciousness when he was found. He was pronounced dead at a hospital.

“It’s an awful night,” Eric Philips, a spokesman for Mayor Bill de Blasio, said in a tweet. “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.”

The cause of the fire was under investigation. The building was home to the former St. Nick’s Jazz Pub, a venerable bar that was closed in 2011.

It was being used to film the adaptation of the Jonathan Lethem novel of the same name. Norton was directing and starring, along with Bruce Willis, Willem Dafoe and Alec Baldwin.

Neighborhood resident Daquan Evans, 28, told the New York Post he saw Norton at the scene, and he looked shaken.

“That actor Ed Norton walked right by. He looked pretty upset,” Evans said. “This is crazy, this fire. You think a movie comes up here and it is good for the neighborhood. Not a fire . . . damn.”

Two other firefighters suffered burns and were in serious condition, and three others were injured, Fire Commissioner Daniel Nigro said.

“Our department and our entire city mourn this tragic loss of a very brave firefighter,” Nigro said.

Producers sent condolences to the family of the firefighter, according to a statement given to 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.

Neighbors said the movie crew had set up a sign that read “King Rooster Jazz Club” about two weeks ago. Cars from the 1950s era lined the street.

“They started building the set two weeks ago and have been here every day,” Nathan Monroe-Yavneh, a neighbor, told the Daily News of New York.

Davidson had been a firefighter about 15 years. He leaves behind a wife, Eileen, and four children, three daughters aged 7, 3, and 1, along with a 6-year-old son. He was the son of retired firefighter Robert Davidson.

A Pennsylvania fire department suffered tragedy this week when two firefighters were fatally injured in the partial collapse of a former piano factory in York.