Eight people, including two children, are dead, and 18 others are injured after a three-story apartment building collapsed in Flatbush on Wednesday afternoon, Mayor Zohran Mamdani said Thursday.

Just after 4 p.m. Thursday the FDNY announced it had concluded a 24-hour search and rescue operation that involved more than 250 firefighters and emergency service workers.

The deceased were identified by police officials on Thursday as: Nicole Daniela Salvada Rodriguez, 9; Kevin Santiago Reyes Gonzalez, 10; Juan Daniel Salvada Guzman, 31; Ndiaye Mamadou, 31; Barry Mamadou, 23; Gabriel Ariolfo Siguencia Yupa, 22; Edgar Sapon, 26; and Jose Luis Caguana Cosquillo, 26.

The building, located near Bedford and Flatbush Avenues, collapsed around 4 p.m. Wednesday into a lot where construction workers had been excavating earlier in the day for a new building, officials said. Six people died at the scene, and two others succumbed to their injuries at nearby hospitals, the mayor said. Two of those who died were construction workers. At least seven of the injured are children. Most of those still hospitalized are in stable condition, though one person is in critical condition, Mamdani said.

Though rain threatened to complicate the rescue effort, FDNY Commissioner Lillian Bonsignore said it would not “stop our operations.”

“ This type of an emergency is something our members train extensively for, and we will be here until we are one hundred percent sure there are no more people trapped,” she said.

The devastation puts the collapse among the worst such disasters in recent city history. The Department of Buildings and law enforcement have begun an investigation into what caused the building to collapse. The developer of the new construction appears to have flouted orders from the buildings department in the past.

Mamdani said five entities were involved in the construction site and are associated with about 100 other projects across the city. The Department of Buildings began a sweep of those sites Thursday, he said.

“If there is anyone or any entity operating in this city that bears responsibility for what happened, we will hold them fully accountable,” Mamdani said.

The scene was chaotic Thursday morning as firefighters, emergency service workers and police officers moved around the site. A demolition excavator worked through the rubble, piling the debris on one end of the lot — a mattress, a refrigerator, wood floor panels — while bricks, clothing and dozens of music records lay scattered across the site.

Families who had spent the night on the sidewalk wrapped in blankets waited for any information about the fate of their loved ones.

Stairways, rooms, closets and clothes were visible in an apartment building shorn in half by the collapse

José Luis Caguana Cosquillo was one of the two construction workers killed at the site, according to the Ecuadorean consul. Segundo Iza stood at the site of the collapse. He said he and Caguana Cosquillo grew up together in Ambato, Ecuador. They’d met playing soccer.

“He was someone who came here to achieve many dreams, to find better days for our children and our parents,” Iza said. “So it’s sad that our friend died here in New York.”

The Ecuadorean consul said Gabriel Ariolfo Siguencia Yupa, 22, was also among those killed.

Assiah Bah, 23, said she and her family were waiting outside all night for news of their two cousins who lived in the collapsed building and were cooking dinner at the time of the disaster.

“We don't know what is going on, if they're still alive or if they passed, we don't know,” Bah said Thursday morning, saying her family immigrated from Guinea.

The extent of injuries and location of those who were caught in the wreckage has been changing throughout the rescue operation.

“We've seen infants, toddlers being pulled out of the rubble on stretchers into ambulances to be rushed to the hospital,” Councilmember Farah Louis said from the scene Wednesday night.

Katie Stevens, a teacher who lives down the block, said she was home, doing her laundry when she heard what sounded almost like a car crash. A few minutes later, she heard sirens and helicopters overhead. She said she found a family with a young boy standing on the sidewalk next to the rubble, crying. “ Can I do anything for you right now?”

“We need everything right now,” Stevens recalled them telling her. She took the young boy to a nearby clothing store to use the restroom. He kept asking her when he could go back home.

“I don't know, love,” Stevens told him. “I don't know. I don't know, but you are safe. Your family is safe. You're gonna be okay.”

The scene of the building collapse in Brooklyn Thursday morning, 11/12

The building collapsed into a hole where construction workers had been excavating for a new building on an adjacent lot earlier in the day, according to the city's buildings commissioner Ahmed Tigani.

“I actually watched it. I was in my room when the building fell down. You could hear it.” Antione Vines said, Wednesday night from the scene. “ Before they build a new building and you're connecting it to another building that’s been up since the 1700s, you gotta look at the structure of the building. You can't just build a new building and connect it.”

Nearly all of the building had caved into the adjacent construction site, shearing off the side of the neighboring residential building, exposing a stairway, a closet full of clothes and a bedroom set.

“We’ve been waiting here all night. We went to four hospitals, and they haven’t given us any information,” Luis Siguencia said of his son, 22-year-old construction worker Gabriel Siguencia, as he anxiously waited at the scene Thursday morning.

“He wanted to get ahead. Because we all come here with the dream of getting ahead. He had his papers and everything.”

Gabriel, who recently arrived from Ecuador, had been working on the foundation at the site for the last two weeks.

New York City's Office of Emergency Management said it has coordinated with the Red Cross to open a reception center for impacted residents at the Flatbush YMCA at 1401 Flatbush Avenue in Brooklyn.

As of 6 a.m., the Red Cross has registered seven households (14 adults and five children) for emergency assistance, including temporary lodging.

Mamdani said anyone searching for a loved one should call 311 or 212-639-9675.

Liam Quigley, Ryan Kost and Catalina Gonella contributed reporting.

This is a developing story and has been updated.