Frantic Philadelphia police dispatch audio captures the tense moments a suspected gunman battled cops in an hours-long standoff — wounding six officers and trapping two others inside the building.

Suspect Maurice Hill, 36, allegedly opened fire on officers with an AK-style rifle as they served a drug warrant at the house in the North Philly neighborhood around 4:30 p.m. Wednesday.

Hill did not surrender to authorities until nearly midnight — and in the meantime, police scanner traffic reveals the harrowing moments gunfire rang out inside the home.

“We’ve got several shot officers!” a dispatcher says in the recording, obtained by local outlet FOX 29. “We’ve got an officer down! They’re still getting shot — shots fired!”

“I got an officer shot at this location in the leg!” one officer can be heard yelling. “They’re saying the shooter is in the kitchen. We’ve got an officer down. Radio: I want Erie Avenue shut down — right now.”

Some officers jumped out of windows in an attempt to escape, but two were trapped on the building’s second floor, according to reports.

One was trapped in a back bedroom with a male and a female hostage, and another in the bathroom with a male hostage, FOX News reported. Each of the hostages had already been handcuffed by the time the gunman opened fire, according to the report.

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

In a recording obtained by the Philadelphia Inquirer, a police commander asks a trapped officer, “How you doing inside?”

“I got full ammo, ready to go,” the officer answers.

SWAT teams and hostage negotiators were called in, and the three hostages and officers were ultimately able to escape unscathed. Three others were rushed to Temple University Hospital and three more to Einstein Medical Center, all with non-life-threatening injuries, according to reports.

Hill surrendered to cops after officers were able to reach him by phone and tossed tear gas into the building.

It was not clear if he was injured in the melee.

No deaths were reported in the shootout.