Assemblyman Charles Barron ​on Thursday warned of riots, saying “violence is inevitable” if former NYPD officer Peter Liang gets the no-jail sentence recommended by Brooklyn District Attorney Ken Thompson.

“We will not forget this,” Barron bellowed to an angry throng of protesters gathered outside Thompson’s downtown Brooklyn office. “Some of our people are saying an eye for an eye, a tooth for a tooth, a life for a life.”

“Even Martin Luther King — the prince of peace — said that riots are the voices of the unheard,” said Barron, a former Black Panther.

“Am I saying we should be violent? I’m saying the system will decide.”

“Don’t make us bring Ferguson to New York City,” ​Barron threatened. “How dare you, after the community invested in you. All the good you’ve done has been wiped out.”

The family of Akai Gurley — who was killed by Liang’s ricocheting bullet in the stairwell of a housing project — called for the protest after Thompson publicized his recommendation that trial Judge Danny Chun sentence the former officer to 500 hours of community service, six months’ home confinement and five years of probation.

“Thankful your hypocrisy is just a recommendation,” Barron yelled. “We ask the judge to ignore this, and do the right thing.”

The assemblyman threatened that, if not, “we will shut this city down, Ken Thompson. Wherever you go, we should be there.”

Gurley’s aunt Hertencia Peterson also addressed the crowd, flanked by a silent and sobbing Melissa Butler — her nephew’s girlfriend, who was with him when he was fatally shot.

“You are just as guilty as if you’d pulled the trigger,” she said of the DA. “We trusted you, and you hoodwinked us.”

Petersen called Thompson a “disgrace” for “looking her in the eyes” and pretending he was seeking justice for her nephew. “You sold yourself to the devil.”

“You will always have Akai Gurley’s blood on your hands,” the distraught aunt shrieked, as protesters around her shouted that Thompson was a “traitor.”

“I don’t want to hear anything from you, or from your office,” she said. “This is a slap in the face.”

Assemblywoman Inez Barron also addressed the increasingly unsettled crowd and the absent DA, saying that “we are revolted by your actions, and we will never forget. Don’t come to us for anything.”

“Ken Thompson, you are forewarned,” she ye​​lled. “This is not the end.”

Nicolas Heyward Sr. and Frank Graham, who both had sons killed by police, also spoke, calling for Liang to serve time in prison.

“We want Peter Liang to go to jail,” Gurley’s cousin Shavon Ford later said. “Go to jail.”

Thompson’s office declined to comment on the protest.