A man who barricaded himself inside a Philadelphia house and opened fire at officers, injuring six, has been taken into custody after more than five hours’ standoff with police.

Philadelphia police spokesman Sergeant Eric Gripp has confirmed that the gunman was apprehended, adding that SWAT teams have been clearing the premises.

The suspect gave himself up to police around midnight, exiting the house with his hands in the air, WTXF-TV reported, citing an officer at the scene.

Multiple media outlets, citing police sources, have identified the gunman as Maurice Hill, 34, a Philadelphia native whose extensive criminal record goes back to the early 2000s.

Hill has been described as a hardened criminal who served multiple stints in prison for an array of serious offenses, ranging from illegal possession of weapons to aggravated assault. He was barred from purchasing firearms due to his criminal record.

One of his run-ins with the law saw Hill plead guilty to a federal firearms violation in 2008, having been caught red-handed with a Smith & Wesson .357 revolver and later a Taurus PT .45 semiautomatic pistol, both of which he was banned from possessing.

A defense attorney, who worked with Hill in the past, has confirmed that his client was involved in the shooting. Lawyer Shaka Johnson told KYW-TV that he was asked by Hill to arrive at the scene and ultimately persuaded him to surrender.