CNN  — 

A suspect has been arrested after he barricaded himself for hours in a North Philadelphia home in a shooting standoff that left six officers wounded, police said.

“Suspect is in custody. SWAT is still clearing the house,” Philadelphia Police Sgt. Eric Gripp tweeted early Thursday.

The shooting started at 4:30 p.m. Wednesday and was followed by a standoff that lasted nearly eight hours.

Two officers and three others who had been trapped inside the row house were evacuated by a SWAT team a few hours before the standoff ended, Philadelphia Police Commissioner Richard Ross Jr. told reporters.

“They were able to use stealth to do it,” he said, adding he didn’t think the shooter was aware of the rescue mission.

Before the standoff ended, negotiators had been trying to communicate with the shooter, but the gunman was only picking up the phone without answering, Ross said at one news conference.

Authorities trying to convince him to surrender were making a little bit of progress. The man’s attorney joined a phone call and tried to assure the suspect that police were not going to harm him.

No serious wounds to officers

The wounded officers’ injuries were non-life threatening. One had a graze wound to the head. All of the wounded have been released from the hospital, Gripp said.

Some officers were in the kitchen of the house when the shooter fired and police shot back. “Many of them had to escape through windows and doors,” he said. The shooter has continued to fire out of the windows, the commissioner said.

Police went to the home in the Nicetown-Tiago neighborhood around 4:30 p.m. ET with a narcotics warrant, Ross said.

A law enforcement source told CNN that it was a state warrant, but at least one person in the house is the subject of a federal law enforcement investigation.

Video from a news helicopter showed more than 50 police vehicles at the scene just after the shooting began.

Police reported sporadic gunfire into the evening.

Four women were escorted out of the building by Philadelphia police SWAT members, said Greg Argos, a reporter for KYW.

The KYW reporter described the women as “visibly upset, crying, as they were escorted down the street.”

One woman said of the officers: “They kept us safe the whole time, the whole time, they kept us safe.”

At different times, Gripp asked media helicopters to clear the area and for people to not fly drones.

President Donald Trump was briefed on the shooting, deputy White House press secretary Hogan Gidley said.

CNN’s Evan Perez, Dave Alsup and Chris Boyette contributed to this report.