Philadelphia District Attorney Larry Krasner negotiated a “phony baloney” sentence with the gunman in the harrowing 7 1/2-hour standoff that ended with six cops shot.

Krasner jumped on the phone with suspect Maurice Hill while he was holding three people hostage Wednesday night, The Philadelphia Inquirer reported.

Hill wanted to know what kind of punishment he was facing.

“Early on, I said 25 [years], then he said 20 and I said OK,” Krasner told the paper.

But it was all a ruse, designed to talk the gunman down.

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

Krasner reportedly took the call around 9 p.m. at the request of Hill’s attorney, who was conferenced in. Krasner took a second call from Hill around 10:15 with multiple prosecutors listening.

“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,” attorney Shaka Johnson told the Inquirer. “But he did allow that man, in his mind, to keep things in play so that he could come out of there.”

Hill appeared to be intoxicated or under the influence of prescription drugs during the standoff, Krasner said.

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