A firefighter died Thursday after falling from the roof of a burning building in Queens, FDNY Commissioner Daniel Nigro said.

"I’m very sorry to report that tragedy has struck our city again and we lost another hero today," Mayor Bill de Blasio said during a news conference Thursday evening. "A man dedicated to protecting others gave his life for this city."

Firefighter William Tolley, 42, was working to ventilate the roof of a five-story building at 1615 Putnam Ave. in Ridgewood in the area of a ladder truck's bucket when he fell, Nigro said. He was taken to Wyckoff Heights Medical Center in Bushwick, Brooklyn, in serious condition, but he later succumbed to his injuries, fire officials said. 

"Everyone is in a state of shock and grief," de Blasio said after meeting with Tolley's family. The 14-year FDNY veteran leaves behind a wife, Marie, and an 8-year-old daughter, Isabella, as well as his parents and a brother.

The investigation into Tolley’s death is expected to take weeks.

Nigro said nothing about the two-alarm fire, which broke out on the second floor of the building at 2:19 p.m. and was brought under control around 3 p.m., appeared suspicious. He added that it was unclear if Tolley's fall had anything to do with the ladder truck's bucket that was nearby.

"The circumstances of the tragedy and the fall are right now under investigation by our safety command and by our Bureau of Fire Investigation," he said, adding that investigators will look at whether there was any mechanical failure on the ladder. “It was really in the operation that he was performing on the roof, which is a routine operation for us, and somehow he fell from the roof.”

Dozens of people gathered by the corner of Putnam and Wyckoff avenues, as several fire officials worked at the scene. A pair of ladders were still attached to the brick building.

Angie Cordero, 43, was in her house directly across the street from the building watching from the second-story window when Tolley fell.

“I was just looking at what was happening. All of the sudden I heard a noise,” she said. “I just saw when the body came over. I started to scream...”

She then ran outside.

"I was pretty shaken up," she said. "[I’m] just thinking you see this in movies, not here. It didn’t feel real.”

Uniformed Firefighters Association President James Slevin called Tolley a "hero" who lived up to the title of "bravest."

"His death is a grim reminder of the dangerous work New York City firefighters do on behalf of our city every single day and [firefighter] Tolley's sacrifice today will never be forgotten," Slevin said in an emailed statement.

De Blasio said the city will continue to support Tolley’s family. 

“We will stand with you not only today, but in the days ahead, and for years and years to come. This is what the FDNY does – stays by families through everything that comes ahead," the mayor said. The FDNY has begun accepting donations to support his daughter’s education.

NYPD Commissioner James O’Neill expressed his condolences to the FDNY in a tweet.

"Thoughts & prayers from all #NYPD are with the men & women of @FDNY following line-of-duty firefighter death today in Queens. Rest in peace."

Rob Campana, 40, left flowers outside of the Engine 286/Ladder 135 station house, where Tolley worked. The flag outside of the building stood solemly at half-staff Thursday evening. 

"It's always tragic," he said, but it was "especially tragic" because Tolley was so young. "I'm just here to pay my respects."

Campana said he feels a lot of empathy and sympathy. "It's always a sad event -- that's the job," he added.

David Prine, 56, lives in the neighborhood and said he knew Tolley. He called the firefighter "big hearted."

Tolley is the 1,147th member of the FDNY to die in the line of duty, according to Nigro.

The most recent FDNY firefighter to be killed in the line of duty was Battalion Chief Michael J. Fahy in September 2016. Fahy, 44, of Yonkers, was killed by falling debris from an explosion that blew the roof off a home in the Bronx. Earlier on Thursday, Fahy's name was added to the Department Line of Duty Memorial Wall at the FDNY's headquarters.

The fire department also lost a beloved EMT, 44-year-old Yadira Arroyo, in March 2017, after she was fatally struck by her own ambulance when a carjacker managed to get behind the wheel.

With Anthony M. DeStefano