UPDATE: Suspect surrendered to police shortly after 12 a.m. Thursday. The suspect’s attorney has identified the alleged gunman as 36-year-old Maurice Hill.

PHILADELPHIA (CBS) — At least six Philadelphia police officers were shot during a gun battle in Philadelphia’s Nicetown-Tioga section and rushed to the hospital on Wednesday afternoon, authorities say. Two officers and three others who were trapped inside the home with the shooter were safely evacuated several hours after the standoff began. The gunman surrendered just after midnight.

“We have gone from a hostage situation to a barricade,” Philadelphia Police Commissioner Richard Ross said.

Ross said that the two officers and three others inside the home took fire during the incident.

Update: 2 PPD Officers who were in house with shooter have been safely evacuated by PPD SWAT. Suspect is still armed and inside house. Continue to avoid the area. — Eric Gripp (@PPDEricGripp) August 15, 2019

All six officers wounded in the shooting have been released from the hospital. Another officer injured in a car crash on the way to the scene still remains hospitalized.

Sources tell CBS3 the suspect was live-streaming some of the shootout while he barricaded himself inside the home.

UPDATE: Hostage situation is now a barricade situation. Prisoners were released. The shooter still hasn’t surrendered, but has stopped firing at police. @CBSPhilly pic.twitter.com/zAh13xftfq — Kimberly Davis CBS3 (@KimberlyDavisTV) August 15, 2019

Ross said it was a miracle no officers were killed.

“It’s nothing short of a miracle that we don’t have multiple officers killed today,” the police commissioner said.

Police say officers were serving a narcotics warrant on the 3700 block of North 15th Street around 4:30 p.m. when the suspect opened fire. As police exchanged gunfire, officers escaped through windows and doors.

CBS3 reports 30 officers discharged their weapons during the shootout.

Two women and two children were escorted by SWAT and Philadelphia Police from the scene. They told CBS3 that they were inside the home on the second floor at the time of the shootout and that police saved them.

“I thank God for these cops,” one woman said.

Officers are attempting to communicate with the shooter; imploring him to surrender and avoid further injuries. — Eric Gripp (@PPDEricGripp) August 14, 2019

PHOTOS: Chaotic Scene Unfolds As 6 Philadelphia Police Officers Shot During Gun Battle In Nicetown-Tioga

Sources tell CBS3 that the scene was sheer chaos as officers were taking fire. Video from Chopper 3 shows officers with guns drawn at the scene. You can hear multiple gun shots during Argos’ report.

WATCH: CBS3 Cameras Capture Volleys Of Gunfire Erupting After 6 Philly Police Officers Shot In Nicetown-Tioga

BREAKING: We just arrived to Temple University Hospital where multiple officers were transported after being shot in North Philadelphia. It is a very active scene here and we’re working to determine the condition of the officers. At least 5 officers injured. @CBSPhilly pic.twitter.com/ULWTk4cHpA — Kimberly Davis CBS3 (@KimberlyDavisTV) August 14, 2019

Mayor Jim Kenney called the officers “brave” and that they need help with gun control to keep weapons out of criminals’ hands.

Kenney said officers “don’t deserve to be shot at for hours.”

Chopper 3 was over the scene where police could be seen taking a suspect into custody. It’s not clear what his role was in the incident.

The scene of the shooting is right down the street from Temple University Hospital.

Shooting incident 3700 N 15th Street. Suspect/(s) firing at police. Large police presence. AVOID AREA — Eric Gripp (@PPDEricGripp) August 14, 2019

Several blocks around the scene have been cordoned off. Most of North Philadelphia is in gridlock due to the police presence.

President Donald Trump has been briefed on the situation.

Lockdown for HSC campus has been lifted. All populations must avoid the incident scene and remain south of Venango St. Allied Security and Temple Police will assist. — Temple University (@TempleUniv) August 14, 2019

Temple University says the lockdown at the Health Sciences Center Campus has been lifted.

SEPTA’s Broad Street Line trains are bypassing Erie, Allegheny and Hunting Park stations until further notice. The express trains will make courtesy stops at North Philadelphia station.

SEPTA bus routes 23, 53, 56, H and XH are currently on detour.

Stay with CBSPhilly.com for updates on this developing story.