Dramatic audio from police dispatchers reveals how two officers became trapped and six others were wounded as gunfire rang out during an hours-long standoff that turned one residential Philadelphia neighborhood upside down Wednesday.

Several officers with the Narcotics Strike Force were serving a warrant at the multifamily home -- in connection with what may have been a drug-related offense -- when things "went awry almost immediately," and the shooter opened fire, police Commissioner Richard Ross Jr. said.

“We’ve got several shot officers. We’ve got an officer down. They’re still getting shot – shots fired,” a female dispatcher said shortly after the gunfire began around 4:30 p.m.

PHILADELPHIA SUSPECT IN CUSTODY AFTER HOURS-LONG ORDEAL THAT LEFT 6 OFFICERS WOUNDED

"We’ve got several shot officers. We’ve got an officer down. They’re still getting shot – shots fired." — Philadelphia police dispatcher

Several officers had entered the home and made their way to the rear of the property when a gunman, armed with an AK-47 rifle and several pistols, began to open fire. Some officers jumped out of windows to escape the barrage of bullets but two officers were trapped inside on the second floor.

“I got an officer shot at this location in the leg!” one officer yelled to a police dispatcher. “They’re saying the shooter is in the kitchen. We’ve got an officer down. Radio: I want Erie Avenue shut down – right now,” another dispatcher said, Philadelphia's FOX 29 reported.

"I got an officer shot at this location in the leg! They’re saying the shooter is in the kitchen. We’ve got an officer down." — Police officer calling in to dispatcher

Dozens of officers responded in patrol cars. Six officers total were wounded in the gunfire and were rushed to local hospitals where they were treated for non-life-threatening injuries and later released. Police blocked off the streets around the scene. At least two other officers were treated for non-life-threatening injuries related to automobile accidents that resulted in the commotion to get to the scene.

Two officers barricaded

While most officers made it out of the home initially, two officers were barricaded in separate rooms on the second floor as the gunman on the first floor shot through the ceiling and outside windows at officers below.

JESSE WATTERS: DEMS POLITICIZING PHILADELPHIA SHOOTING

“Be advised. We’re still pinned down inside this location,” one of the officers said over the radio around 5 p.m. “The male is inside the kitchen shooting upward and forward to the opposition of the police.”

“Be advised. We’re still pinned down inside this location. The male is inside the kitchen shooting upward and forward to the opposition of the police.” — Officer heard on police radio

One officer was trapped in a back bedroom with a male and a female hostage. Another officer was trapped in a bathroom with a male hostage. The hostages had already been handcuffed by police at the time the shooting began.

“How you doing inside?” a police commander asked an officer inside, the Philadelphia Inquirer reported. “I got full ammo, ready to go,” the officer radioed back.

SWAT and hostage negotiators were called in. The two officers and three hostages managed to escape without being harmed with the help of the SWAT team around 10 p.m. as the standoff continued. Police eventually rescued four more women who were trapped on the second floor amid the gunfire.

Daycare center on lockdown

Hundreds of rounds of gunfire could be heard throughout the afternoon. A nearby daycare was placed under lockdown until law enforcement could evacuate 58 children and adults from the building, the Inquirer reported.

“We had to stay calm and collected, and get the children calm,” one daycare worker said. “I’m just happy I got my daughter,” Shere Calhoun said as she caressed her 8-year-old’s head. “I didn’t want her to be a victim.”

“We had to stay calm and collected, and get the children calm. ... I’m just happy I got my daughter. ... I didn’t want her to be a victim.” — Shere Calhoun, parent of 8-year-old

Police called in two city buses to hold the children whose parents had not arrived yet as the shootout continued blocks away. Temple University also placed its health and science campus, which includes the hospital, on lockdown.

CLICK HERE TO GET THE FOX NEWS APP

“Calm down, calm down,” an officer yelled as a parent ran down the block. “The kids are safe.”

Law enforcement tried to communicate with the suspect both over the loudspeaker and on the phone to defuse the situation. The suspect’s girlfriend facilitated communication during the first call. A second three-way call transpired with the suspect, his attorney and police to urge the suspect he would not be hurt if he surrendered. After almost an eight-hour-long ordeal, the suspect surrendered to authorities just after midnight Thursday, exiting the residence with his hands in the air and with a police light shining on him, surrounded by a cloud of tear gas.

The Philadelphia Police Department didn't officially release the name of the suspect, but unnamed police sources told the Inquirer that he was Maurice Hill, 36, of Philadelphia. Hill has a long criminal record, including several gun-related convictions and has been arrested for attempted murder and resisting arrest, the newspaper reported, citing court records.

The Associated Press contributed to this story.