A quiet Roslindale neighborhood was pitched into chaos Tuesday evening when a gun battle broke out between police conducting a firearms investigation and two suspects, one of whom became the subject of a lengthy manhunt.

The volleys of gunfire forced the suspension of commuter trains on the Needham line, which passes near Newburg Street, where the shots erupted just before 5 p.m. Stunned residents spent hours sheltering in place, while police searched homes and backyards while helicopters hovered overhead.

“I’ve never seen anything like this in the neighborhood before,” said Krikor Garabedian, 47, a long-time Aldrich Street resident. “I thought it was like Fourth of July fireworks.”

Both Boston police and State Police were involved in the gun fight. No one was wounded in the exchange, Boston Police Commissioner William B. Evans said in a press conference Tuesday night, but one Boston officer was sent to a local hospital with a minor injury.

The first suspect was identified by police as Luis Colon, 25, of Boston .

Police identified the second man who initially evaded capture as Eric Rosado-Gonzalez, 25, of Dorchester.

Rosado-Gonzalez was captured about 9:35 p.m., police said.

“I want to commend my officers for quick capture,” Evans posted on Twitter shortly after 10 p.m.

“Our city is a safer place with him in custody,” he said.

Both men are scheduled to be arraigned Wednesday in West Roxbury District Court on charges including assault with intent to murder a police officer.

Rosado-Gonzalez also has default warrants for open drug cases in Chelsea and Dorchester, according to a police document.

Evans said at least one of the suspects fired at police first, and police fired back.

Residents described a confusing and terrifying scene as their neighborhood filled instantly with police and flashing blue lights.

Three people said they heard a speeding car screech to a halt, and then a volley of gunfire of between three and seven shots. Another volley followed after a pause, the residents said.

One resident, who gave her name only as Barbara, said she then heard the car peel away; another resident who called 911 said he heard yelling once the gunfire subsided.

Garabedian, who lives one street over from the area of 20 Newburg St., said he looked outside after he heard the gunfire and saw two men running across his street toward Newburg Street.

He could not see if the men had guns, he said. It was not clear if they were suspects or plainclothes officers.

State Police spokesman David Procopio said that Boston police SWAT team members, a State Police tactical team, and Transit Police were among the legions of officers who came to help search the area, with the assistance of K-9 units and the State Police Air Wing.

About 45 minutes after the gunfire, officials and residents said, a SWAT team raided a home on Newburg Street.

As police continued to search, residents gathered by the crime scene tape to watch.

“I didn’t know anybody would be that bold to do that,” said Lamar Hamilton, 16, who said he was stunned that someone would fire on officers. “It’s pretty crazy.”

Others discussed the search that turned their yards into potential crime scenes.

“We have a shed that doesn’t lock and an officer with a bulletproof vest and a gun at the ready just appeared in our backyard,” resident Michelle Geffken said. “He looked around the yard, quickly swung open the doors and no one was in there.”

Police checked her neighbor’s yard, too, she said.

“They have a chicken coop, which could be a really good place to hide,” she said.

Andy Rosen of the Globe staff and Globe correspondents Olivia Quintana and Reenat Sinay contributed to this report. Evan Allen can be reached at evan.allen@globe.com. Follow her on Twitter @EvanMAllen. Travis Andersen can be reached at travis.andersen@globe.com. Follow him on Twitter @TAGlobe.