While Maurice Hill was holed up in a North Philadelphia rowhouse Wednesday night with an AR-15 rifle, he got on the phone with District Attorney Larry Krasner.

Six police officers had already been shot and wounded, and two more were trapped inside the Tioga house, along with three handcuffed prisoners. Krasner hoped to persuade Hill to surrender; the suspected gunman wanted to know what kind of prison term he might face.

“Early on, I said 25 [years], then he said 20 and I said OK,” Krasner recounted Friday. At one point, Hill insisted on a deal in writing. Krasner started writing a draft, but did not finish it.

The conversation occurred 4½ hours after the standoff began, as officers were still being treated at hospitals, and 3 hours before it ended with Hill’s surrender and no more bloodshed. In an interview Friday, Krasner described his offer as a “phony baloney” agreement that he had no intention of honoring — and said Hill’s lawyer was in on the ruse.

“We need to be clear here: This was bulls— from the beginning,” Krasner said.

The revelation that Philadelphia’s top prosecutor was discussing plea deals with an active gunman and his lawyer added another twist to the mass shooting that drew a national spotlight to the city. The fake offer would have been unusually lenient — a Delaware County man got nearly 50 years in prison for wounding a single officer in a 2016 West Philadelphia shooting. And some questioned the tactic, while others wondered whether it could create unforeseen issues as the case proceeds — including turning the district attorney into a witness.

“We find that when we overpromise or deceive the person, it tends to backfire on us," said Gary Noesner, retired chief of the FBI’s Crisis Negotiation Unit, who in his career was called in to defuse prison riots, airplane hijackings, and the 1993 Branch Davidian standoff in Waco, Texas. “If you promise them what you can’t deliver, it can sound phony [or] like you’re just trying to tell them whatever they want to hear. What ultimately convinces people to surrender is that they feel you’re being honest and upfront with them.”

Daniel Filler, dean of Drexel University’s Kline School of Law, said the fact that Hill’s attorney, Shaka M. Johnson, was apparently involved in a bogus plea deal could be problematic. “If that lawyer has been retained by a client, then that defense lawyer probably has some duty to the client to disclose that this is simply a charade," Filler said.

Hill, 36, remained jailed Friday as police and prosecutors prepared to formally charge him in the Wednesday attack. Krasner said the charges were likely to include multiple counts of attempted murder, assault, weapons violation, and other offenses.

» READ MORE: Commissioner Ross recounts trying to talk gunman into surrendering during standoff

All signs suggested the case would remain in the hands of Philadelphia’s prosecutors. A spokesperson for Pennsylvania Attorney General Josh Shapiro said in an email that questions about jurisdiction depend on the facts of each case. But spokesperson Jackie Rhoads added: “Because district attorneys’ offices are usually best positioned to gather and assess those facts, they customarily make the determination [whether] there is a conflict and a case should be referred to another agency for prosecution.”

In an interview with The Inquirer, Krasner described and defended his role in the Wednesday night standoff. He said he had stopped at home to change clothes and eat, and was watching the event unfold on television when he got a call from Johnson, who Krasner knows from his years as a defense attorney. Krasner missed a first call from Johnson, but quickly called him back. Johnson then patched in Hill for a three-way call at 9:06 p.m.

Johnson said Friday that Krasner didn’t offer Hill a particular prison sentence and was more focused on keeping him calm. The fact that Krasner got on the phone without hesitation, Johnson said, was “leading from the front, as a commander.”

“When [Hill] started talking about things that those of us in the business knew could not happen, [Krasner] did not thwart the negotiations by shutting him down immediately, nor did he promise him anything that ultimately couldn’t get done,” Johnson said. “But he did allow that man, in his mind, to keep things in play so that he could come out of there.”

Back at the District Attorney’s Office, Krasner resumed surrender talks in a second conference call at 10:15 with Hill, Johnson, and Police Commissioner Richard Ross, who called in from the scene. The conversation was on a speakerphone in the Homicide Unit, overheard by multiple prosecutors. Krasner said he let his colleagues know he was bluffing Hill and sent texts to Ross to “make sure he understood this was talk, not a reality.”

Krasner said the suspected gunman seemed intoxicated, possibly abusing prescription pills. He hoped Hill might tire of holding out as the night wore on.

“I would have gone roller skating with the man if that would have gotten him out of there,” Krasner said Friday.

U.S. Attorney William M. McSwain said he learned from police after Hill had surrendered that the alleged shooter had been also asking to speak with him during the standoff. “We obviously weren’t going to make any decisions … or promise anything to the suspect,” he said at a news conference Thursday.

McSwain never got on the phone with him.

Because Johnson and Krasner did, it’s possible both could become witnesses in Hill’s prosecution — and could have to recuse themselves from the case.

“You can’t be both a witness and an advocate,” said Stephen Gillers, an expert on legal ethics at New York University Law School. “If the prosecution or the defense wants to call [the district attorney] as a witness, he can’t participate in the prosecution of the case.”

But Gillers said if the focus of Hill’s charges is the shootings — and not the hours-long negotiations that followed — the conversations among Hill, Johnson, and Krasner wouldn’t be a factor at trial.

As for Hill’s lawyer, Robert H. Davis Jr., a Widener University professor of legal ethics, said attorney ethics rules require lawyers to present truthful and accurate information to their clients. But Davis said Wednesday’s tense situation might prove an exception to the rule.

“As a practical matter, what the hell is the harm?” he said. “He very well may have saved his client’s life.”

Staff writers Chris Palmer and Julie Shaw contributed to this article.