Fire marshals have determined that two children playing with matches caused a six-alarm Staten Island fire Thursday that injured 23 people and left dozens homeless, the city fire department said.

The FDNY said flames broke out at a house located at 228 Benziger Ave. near Jersey Street in New Brighton just after 6 p.m.

The fire quickly spread and damaged four adjacent homes.

It took crews around three hours to bring the flames under control.

The house where the fire began has been completely destroyed.

Residents who spoke with NY1 at the scene say they're just relieved no one was killed. 

"Flames broke out, everybody was in the street. Everybody got the kids, then we saw the fire truck, you know going up," said one witness.

"All my stuff, pictures, artwork I can't replace. I'm hoping the cat got out, but all the kids, everybody in the house, all, both houses, everybody's accounted for. So at the end of the day, no loss of human life," said a displaced resident.

The fire department says one resident was seriously injured and is in stable condition.

Two other people and 20 firefighters suffered minor injuries.

The city Department of Buildings is investigating the scene.

The Red Cross is helping 55 people displaced by the fire, including at least 20 children.

The boys, who are 6 and 8 years old, the FDNY said, will be entered into a program that the fire department runs to teach kids about fire safety and prevention.