The suspect accused of shooting six police officers during an hourslong standoff in Philadelphia last week was given a phony deal by the city's district attorney — who said it was "bulls---" from the start.

Maurice Hill, 36, allegedly opened fire with an AR-15 rifle on police officers who were serving a drug warrant Wednesday, officials said. The situation went awry "almost immediately," and six officers were ultimately wounded.

PHILADELPHIA POLICE SHOOTING SUSPECT HAS 'EXTENSIVE' CRIMINAL HISTORY, COMMISSIONER SAYS

Hill faces multiple counts of attempted murder, aggravated assault, assault on a law enforcement officer and reckless endangering related to the shooting.

Around 4 ½ hours into the 7 ½-hour standoff, Hill was apparently curious about what kind of prison term he could be facing as he was encouraged to surrender.

District Attorney Larry Krasner said when he initially told Hill he could be facing 25 years in prison, Hill tried to negotiate and "said 20" — to which Krasner agreed.

“We need to be clear here: This was bulls--- from the beginning,” Krasner told The Philadelphia Inquirer, describing the agreement as "phony baloney."

Krasner said Hill requested the agreement in writing — which the district attorney claimed he started, but never finished. He said the suspect's lawyer was in on the mock agreement.

Investigators said Hill fired more than 100 rounds and surrendered when police deployed tear gas. No one died or suffered life-threatening injuries during the attack.

Hill has an extensive criminal record that includes multiple arrests in Philadelphia and adjacent Delaware County between 2001 and 2012, according to online records. His criminal convictions include assault, perjury, fleeing and eluding, escape and weapons offenses.

CLICK HERE TO GET THE FOX NEWS APP

He served three stints in state prisons, with one of those coming on account of a probation violation. He was also sentenced to 55 months in federal prison over a pair of convictions for being a felon in possession of firearms.

The suspect allegedly used a semi-automatic rifle and a handgun during the shooting, which authorities have said he should not have been allowed to legally obtain due to his record.

Fox News' Melissa Leon and The Associated Press contributed to this report.