Maurice Hill/Philly Standoff

A man accused of shooting six Philadelphia police officers during a standoff that lasted more than seven hours has surrendered to police. 

NBC Philadelphia was there as a member of the SWAT team shot tear gas into the home on North 15th and Butler streets around midnight. The suspect, identified by police as 36-year-old Maurice Hill of Philadelphia, then walked out of the home and was taken into custody by police. He had a gun on him at the time, Philadelphia Police Commissioner Richard Ross said.

Hill was taken to Temple University Hospital for an evaluation. He was released from the hospital to police custody Thursday morning.

He is likely to be charged with six counts of attempted murder and aggravated assault, according to his longtime attorney Shaka Johnson.

Around 8:30 p.m., Hill told the attorney via phone that he "wanted to try to figure a way out," Johnson told NBC Philadelphia.

"He said he wouldn't come out unless I was standing outside because he knows I wouldn't allow anything to happen to him," Johnson said. 

The arrest ended a dramatic, hours-long standoff in which six officers were wounded by gunfire while another was hurt in a crash. Two Philadelphia police officers and three civilians were also trapped inside the row home with the gunman before they were safely evacuated around 10 p.m. Wednesday.

"SWAT was able to successfully extract the two police officers that were trapped upstairs, as well as three prisoners," Ross said. "They were all taken out safely thus far."

None of the officers suffered life-threatening injuries, Ross said, adding that at least one officer suffered a graze wound to the head. The officers were all later released from the hospital.

"This could have been even more dangerous and volatile were it not for the professionalism of that SWAT unit," Ross said, while calling it "amazing" that they got out the trapped officers and civilians.

Officers Who Were Shot During Standoff Released From HospitalOfficers Who Were Shot During Standoff Released From Hospital

Six Philadelphia police officers who were shot during a standoff in Nicetown-Tioga section have been released from the hospital. Officials are calling it a miracle that no officers were killed during the hours-long gun battle.

The standoff with the suspect, believed to be heavily armed with weapons including an AK-47, lasted for more than seven hours before he was taken into custody. The commissioner was even at the scene during negotiations, a first-time move Ross called "unorthodox."

The initial shooting prompted a massive response to the largely residential North Philadelphia neighborhood, which is roughly 2 miles north of Temple University and about 4 miles north of Center City.

Gunfire initially erupted around 4:30 p.m. after narcotics officers served a warrant to a house near the corner of North 15th and West Butler streets, according to officials.

As officers rushed upstairs, a gunman waiting downstairs with an AK-47 fired several rounds through the ceiling. Police returned fire while several officers escaped through windows and doors.

"He was hell-bent on doing whatever he was going to do," Ross said while talking with reporters Thursday morning.

Listen to the Moment Shooting Broke Out in North Philadelphia

A seventh police officer responding to the scene was injured in a car accident at the nearby intersection of North Broad and West Cayuga streets. A pedestrian was also injured, police said.

Hill has an "extensive" criminal history, Ross said. The suspect also recently became a father again, his attorney said.

Police originally went to the home due to suspected drug activity.

There were initially conflicting reports about others who may have been taken into police custody in the aftermath of the initial raid. Police initially said at least one person was taken into custody, but Ross later said that he couldn't say with certainty that anyone remained in custody.

Neighbors said they watched in terror as the violent scene unfolded on their block. 

"It was like a war - like a scene that you see in war," a resident told NBC10. "The guns, the fire, the noise - it was like bombs going off simultaneously at a time where people are having dinner."

Frantic calls from responding officers were obtained by NBC10 via Broadcastify. Policed pleaded for back-up shortly after the shooting started.

"Officer calls for everything you got. SWAT, long gun," a law enforcement officer can be heard saying on the audio. "I got an officer shot."

The officers were seen crouching behind cars, blocking off surrounding streets and surrounding several nearby homes as the firefight unfolded. 

Nearby, stunned families and neighbors gathered behind police tape. Several churches and a day care are in the immediate area.

That day care, Precious Babies Learning Academy, serves children as young as 8 weeks old. It was placed on lockdown while some 80 children huddled inside, according to owner Yvonne Thomas-Curry.

"It was reported that all the children are safe, however we still are asking the parents to not come near the scene," she said. "It still is dangerous. Children will remain in shelter in place and safe inside with their teachers."

As Thomas-Curry spoke to NBC10, the children were escorted out of the day care by police. They were reunited with their families at a safe location.

The stunning "firefight," as police described it, gripped the region and garnered national attention.

Pennsylvania Gov. Tom Wolf and President Donald Trump both said they were monitoring the developing situation.

"Tonight is another reminder of the selfless sacrifice of our law enforcement officers and first responders," Wolf said. "We are praying for a peaceful resolution and the full recovery of all those injured. We must remain committed to combating violence and getting dangerous weapons out of our communities."

Wolf also announced Wednesday night that he's postponing the signing of an executive order to reduce gun violence from Thursday to a later date that has not yet been determined.

During a late Wednesday evening news conference, Mayor Jim Kenney pleaded for gun control in the wake of the shooting. 

"It's aggravating. It's saddening," he said. "It's just something we need to do something about. And if the state and federal government doesn't want to stand up to the NRA and some other folks, then let us police ourselves. But they preempt us on all kinds of gun control legislation."

Kenney also said that police officers deserve to be protected.

"They don't deserve to be shot at by a guy for four hours with an unlimited supply of weapons and an unlimited supply of bullets," he said. "It's disgusting and we've got to do something about it. And we need to do something about it quickly."

Democratic vice presidential candidate, Joe Biden, a Scranton, Pennsylvania, native, tweeted his response to the shooting:

"Dr. Biden and I send our prayers to the police officers injured today in Philadelphia, and to their families who wake up every day knowing that their loved ones are walking into harm's way when they put on the badge. We're grateful for the selfless work they do to keep us safe."

District Attorney Larry Krasner and U.S. Attorney William McSwain were among several local leaders who arrived at the hospital shortly after injured officers were taken for medical treatment.

A lockdown at Temple University's Health Sciences Center campus was lifted after several hours.

The shooting caused major delays for SEPTA's bus and trolley services.