Philadelphia police arrested the suspected gunman who battled cops in an hours-long standoff and shootout that left six officers wounded and another injured in a car crash, authorities said.

Maurice Hill, 36, was taken into custody soon after midnight after the standoff in the Nicetown-Tioga neighborhood, Philadelphia police Sgt. Eric Gripp said on Twitter.

Hill surrendered to cops after officers were able to reach him by phone and tossed tear gas into the building, according to the Philadelphia Inquirer.

It was not clear if he was injured in the melee.

The six officers who were wounded in the shootout were released from the hospital Wednesday night. Another cop injured in a car crash near the scene was still being treated.

The suspect allegedly opened fire on the officers with an AK-style rifle as they served a drug warrant at the house in the North Philly neighborhood Wednesday afternoon.

Additional forces, including SWAT teams, descended on the home around 4:30 p.m. and could be seen returning gunfire.

Officials told reporters that the male suspect had barricaded himself inside, and was shooting at responding officers from within the residence.

“Even when I was on scene, he fired multiple rounds — many of which struck the SWAT truck,” said PPD Commissioner Richard Ross at an evening press conference.

No deaths were reported in the shootout.