Philadelphia Police Commissioner Richard Ross and District Attorney Larry Krasner said Thursday that they personally negotiated with the gunman who allegedly shot six police officers Wednesday night before he surrendered in North Philadelphia’s Tioga section.

“This was the first time, and I hope it is the last time,” Ross said of the unusual foray into speaking with a barricaded gunman.

“I did what I could,” Krasner said. “I am no hostage negotiator, I have no such training. … We did what we could.”

At separate news conferences a day after the 7½-hour standoff, the city’s two top law enforcement officials praised the actions of the responding officers for enabling the situation to end without a loss of life, and spoke of their roles in the resolution, which each man said was just one piece in a larger operation that involved dozens of uniformed officers.

» SPECIAL REPORT: How a routine drug raid unfolded into a hail of bullets, chaos, tense phone calls and miraculously little bloodshed

Ross and Krasner said that over several chaotic hours, they were in frequent communication by phone with each other; with the suspected shooter, Maurice Hill; and with Hill’s attorney, Shaka Johnson, before Hill surrendered amid a cloud of tear gas.

» PHOTOS: Police swarm North Philly neighborhood after officers are shot

Ross said Hill, 36, rebuffed initial attempts by police to negotiate with him by phone, even though Hill reportedly was using it to talk to other people, including his girlfriend, with whom he recently had a daughter.

At some point, Ross said, he asked the police negotiator who was trying to make contact if it would help if he talked to Hill, and the negotiator agreed. He said an officer from the bomb squad gave him a flak jacket to wear during the negotiation.

The negotiator instructed Ross on what questions to ask throughout his communications with the gunman, the commissioner said. Hill, he said, spoke of his newborn daughter and his criminal record.

“In fact, he told me on the phone, he used the word extensive, he had an extensive criminal history, and that he knew the system, and why he was making the outlandish demands he was making,” Ross said, without detailing those demands. “But we weren’t going to lie to him and tell him we were going to acquiesce to what he wanted, because that’s not what you do either, because that creates problems as well."

» READ MORE: In North Philly standoff, alleged cop shooter Maurice Hill has a long criminal history

Krasner, speaking at a news conference Thursday, said he got a cell-phone call around 9 p.m. Wednesday from Johnson, a lawyer he knew from his years as a criminal defense attorney.

Krasner said Johnson told him he represented Hill and was trying to broker a peaceful resolution to the standoff. Shortly afterward, Krasner said, Johnson patched Hill into the call — part of what became an ongoing dialogue that Krasner, Johnson, and Ross had via phone for the rest of the night trying to persuade Hill to surrender, the district attorney said.

Sometimes, Krasner said, all four men were on the phone at the same time.

Ross said one thing that weighed heavily on him during negotiations was the fact that two police officers were trapped inside the house.

He also said he felt “bad” about not going to Einstein Medical Center to visit some of the wounded officers, “but given the fact we had two officers trapped, I just couldn’t leave that scene. I just couldn’t leave that scene.”

The trapped officers were hiding with three people in custody in handcuffs in a bathroom on the second floor of the rowhouse while the gunman was periodically shooting through the floor below them, Ross said. They had gone into the bathroom in hopes that the tile floor would help protect them from the bullets. The officers communicated at first by radio and then by cell phone with supervisors outside, alerting them to their positions and receiving instructions on a plan to rescue them.

"The gist of the conversations were where they were, were they OK, and at some point letting them know what we were doing so that they could know, should they hear things like breaking glass, which we had to do at different times to offer vantage points for the [trapped] police officers,“ Ross said.

He said he did not know if the gunman on the first floor knew that anyone was upstairs. Ross also said that the trapped officers rebuffed requests for backup, advising colleagues that entering the house might result in their getting shot — a decision Ross described as courageous.

Around 9:30 p.m., five hours after the standoff began, SWAT officers made their move and rescued the two officers and the three people in their custody without firing a shot.

“It would’ve been even more dangerous and violent were it not for the professionalism of that SWAT unit,” Ross said. “The manner in which they got those officers out who were trapped, and those other civilians who were trapped, was just amazing to me. They were able to do that in such a clandestine way without drawing fire from him. Obviously there were attempts to distract him.”

Krasner described the extraction effort as “incredible.” Ross declined to elaborate on how those in the house were taken out, but said the rescue transformed what was a hostage situation into a barricaded shooter situation.

That allowed officers to use tear gas on the house to try to force Hill to leave the house, Ross said.

“We would not have taken the last action we took, which was tear gas, with those other people inside. Because then you don’t know what he would’ve done,” Ross said.

Johnson, in an interview Thursday, said he was on the phone with Hill as Hill left the house with his hands up.

“I’m telling him, ‘Put the phone down, put the phone down and surrender yourself,’ and I want you to say: ‘I’m coming out, I don’t have any weapons.’ Say that so they’ll hear it,” Johnson recalled.

Hill exited the house with his hands up and surrendered shortly after midnight.

Krasner praised the department’s use of tear gas, noting that hours of efforts over the phone had allowed the situation to progress only so far.

“It was timely, careful use of tear gas that brought Mr. Hill out safely,” Krasner said.

Ross said he had not expected Hill to give up peacefully.

“I was surprised he came out,” Ross said. “He indicated he wasn’t going back” to jail.

» READ MORE: After hours of fear, terrified parents comfort children after day-care lockdown near North Philly police shooting