CHICAGO (CBS) — A Far South Side man accused of shooting at a Chicago Police officer lashed out at a Cook County judge in court Tuesday, saying he should have just “smoked his a ‑ ‑” after being ordered held without bail, the Chicago Sun-Times is reporting.

“Chicago Police shot at me first,” Kentrell Pledger, a reputed Black Disciple gang member, pleaded with Judge Adam Bourgeois Jr.

As sheriff’s deputies led Pledger away, his protests grew louder: “He shot at me first. So get your story straight, dog. And for that, I should have smoked his a ‑ ‑.”

Pledger then told Bourgeois, who is African-American, “You ain’t black, you’re white, b ‑ ‑ ‑ ‑ ‑.”

A picture of Pledger holding the same weapon used in the shooting Monday in the 300 block of West 106th was posted on social media two hours earlier, Assistant State’s Attorney Guy Lisuzzo said.

When Pledger was arrested after officers found him hiding under a nearby porch, he came out with his hands up, according to a police report.

He allegedly continued to tell the police that he left the gun under the porch wrapped in his red T-shirt.

Pledger, 29, also had one more thing to tell the arresting officers, according to the police report: “Thank you for not shooting me.”

The police officer was patrolling with others in an unmarked vehicle about 2:15 p.m. Monday when they saw Pledger walking on the sidewalk, fidgeting with his belt in the 300 block of West 105th, Lisuzzo said.

They pulled alongside Pledger and the uniformed officer started asking him questions, Lisuzzo said.

Pledger ran away as he took a gun out from his pants and the officer started chasing him on foot, Lisuzzo said.

When Pledger ran toward the end of an alley, he looked back and fired twice at the officer, Lisuzzo said.

The officer was not injured, and he returned fire, Lisuzzo said.

Pledger was not hurt and fled, authorities said.

When Pledger was arrested, he was shirtless and officers found a .40-caliber handgun under the porch in a T-shirt, Lisuzzo said. Officers also found suspected heroin in Pledger’s wallet, Lisuzzo said.

Pledger allegedly admitted to firing a gun at the officer.

Pledger, of the 400 block of West 103rd, was charged with attempted murder of a police officer, aggravated assault of a police officer, aggravated discharge of a firearm and possession of a controlled substance.

(Source: Sun-Times Media Wire © Chicago Sun-Times 2016. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)