HOUSTON – Three men were killed and two others were injured after a homeowner in Texas fired dozens of shots during a home invasion early Sunday, officials said.

The shooting occurred around 1 a.m. in east Houston after five men wearing ski masks forced their way into the home, police told KPRC.

The male resident inside then grabbed his weapon and opened fire at the men.

“The homeowner appears to have defended himself,” Houston Police Department homicide detective Travis Miller told KTRK-TV.

A shootout then took place between opposing sides, according to police.

“We have multiple, multiple shell casings from several different types of guns,” Miller said.

A neighbor told KTRK he heard the shots and went outside to make sure he wasn’t dreaming.

“I heard around five or six gunshots,” he told the television station. “I’m pretty sure there were more before that.”

One of the suspects was found dead in front of the house, while the others fled in an SUV and on foot. Police told KPRC that the SUV crashed into a pole nearby and a second suspect was found dead inside.

A third suspect who was in the SUV fled, collapsed in the street, and later died, KPRC reported.

Watch the latest video at foxnews.com

The fourth and fifth suspects, who were also injured in the shooting, were taken to the hospital. The incident remains under investigation by police, who did not release additional information. The homeowner was not injured.