Lori Maslow, an elected district leader and ex-vice chair of the Brooklyn Democratic Party, resigned from office Thursday after several mayoral candidates threatened to boycott a Sunday forum the county party was sponsoring over her anti-Asian comments.

Maslow wrote “I can’t even look at Chinese food” during an anti-China social media rant on Twitter last month, while posting a link to a news article about Chinese tariffs on US goods.

“We’re sick of buying from China. They did this to us. They lied to us. And yes, Trump played outside role as well. I, for one, will never, ever buy anything made in China again. Join me,” Maslow said.

She then added “I can’t even look at Chinese food,” to the end of the tweet, which was deleted, but not before a reader snapped a screen grab.

Following thundering criticism, Maslow apologized and had already resigned her post as a party vice chairwoman. But it wasn’t enough for critics.

Opposition to her comments became a more serious problem after several mayoral candidates — including Andrew Yang, whose parents emigrated from Taiwan, city Comptroller Scott Stringer and Maya Wiley, among others — said they wouldn’t participate in the Brooklyn Democratic Party’s Sunday mayoral forum moderated by NY1 political anchor Errol Louis. even though Brooklyn Democratic Party chairwoman Rodneyse Bichotte condemned Maslow’s remarks.

Maslow, in a heartfelt and bitter statement of resignation Thursday, indicated she didn’t want to be a liability for the Brooklyn Democratic Party leadership.

“I ask that my statements not be attributed to the Brooklyn Democratic Leadership — I was the writer, not the party leadership. My constituents elected me, and I am responsible to them,” said Maslow, a veteran public school teacher and Marine Park resident who represents the 41st Assembly District.

But Maslow complained she was railroaded by left-wing extremists in the party engaging in cancel culture, and feared for her safety.

“Since this faction began the online harassment and vilification, I have received threatening messages. My family is very concerned for my safety,” she said.

“Extremism in this country is not limited to right wing militias. Threats are nothing to ignore. That is why I will be stepping down effective immediately,” Maslow said.

The Kings County Democratic County Committee has been beset by factionalism and litigation over its operations amid the coronavirus pandemic.