WASHINGTON — Roseanne Barr has apologized for targeting one of President Barack Obama’s senior advisers as the offspring of the “Muslim Brotherhood & Planet of the Apes,” as she responded to a social media conspiracy theory about President Donald Trump’s predecessor.

“I apologize to Valerie Jarrett and to all Americans. I am truly sorry for making a bad joke about her politics and her looks. I should have known better. Forgive me-my joke was in bad taste,” Barr wrote on Twitter, later adding, “I am now leaving Twitter.”

I apologize to Valerie Jarrett and to all Americans. I am truly sorry for making a bad joke about her politics and her looks. I should have known better. Forgive me-my joke was in bad taste. — Roseanne Barr (@therealroseanne) May 29, 2018

I apologize. I am now leaving Twitter. — Roseanne Barr (@therealroseanne) May 29, 2018

Barr previously referred to Obama aide Valerie Jarrett as “muslim brotherhood & planet of the apes had a baby=vj.” She was responding to a Tweet that alleged that “Jarrett helped hide a lot.” That was a reference to a Wikileaks claim that the CIA during Obama’s term spied on candidates for the French election.

https://twitter.com/therealroseanne/status/1001353729872773121

Barr stars in the ABC revival of her sitcom, which has been renewed for another season. A spokesman for the network did not immediately return a request for comment. A spokesman for Jarrett said she had no comment.

Barr’s tweet was met with immediate condemnation despite her apology. Among those speaking out was her co-star and fellow “Roseanne” executive producer Sara Gilbert. Gilbert called Barr’s remarks “abhorrent” and said she was “disappointed in her actions to say the least.”

Roseanne’s recent comments about Valerie Jarrett, and so much more, are abhorrent and do not reflect the beliefs of our cast and crew or anyone associated with our show. I am disappointed in her actions to say the least. — sara gilbert (@THEsaragilbert) May 29, 2018

Gilbert sought to distance the show from its namesake star. “Roseanne,” she asserted, remains an entity “separate and apart from the opinions and words of one cast member.” But the backlash was clearly growing in the hours after Barr’s tweet and apology. “Roseanne” consulting producer Wanda Sykes, who is African-American, announced via Twiter that she would not return to the show for its second season.

This is incredibly sad and difficult for all of us, as we’ve created a show that we believe in, are proud of, and that audiences love— one that is separate and apart from the opinions and words of one cast member. — sara gilbert (@THEsaragilbert) May 29, 2018

During Obama’s administration, Jarrett was one of the president’s closest advisers. Jarrett, an African-American, was born in Iran to American parents.

Barr responded to criticism that her tweet was racist by writing, “Muslims r not a race.”

Barr also tweeted about Chelsea Clinton, referring to her as “Chelsea Soros Clinton.” That is a reference to George Soros, the billionaire who has helped fund progressive causes. Clinton fired back with her own response, writing, “Good morning Roseanne – my given middle name is Victoria. I imagine George Soros’s nephews are lovely people. I’m just not married to one. I am grateful for the important work @ OpenSociety does in the world. Have a great day!”

Good morning Roseanne – my given middle name is Victoria. I imagine George Soros’s nephews are lovely people. I’m just not married to one. I am grateful for the important work @OpenSociety does in the world. Have a great day! https://t.co/mXokiTEwN7 — Chelsea Clinton (@ChelseaClinton) May 29, 2018

Barr’s apology did not stop calls for ABC to respond.

Joe Scarborough, host of MSNBC’s “Morning Joe,” wrote, “Hey @ ABC, Roseanne Barr compared Valerie Jarrett to an ape. There is no apology she can make that justifies @ ABC turning a blind eye to this bigotry by airing another second of her show. Even in the Age of Trump, there are red lines that can never be crossed. This is one.”

Hey @ABC, Roseanne Barr compared Valerie Jarrett to an ape. There is no apology she can make that justifies @ABC turning a blind eye to this bigotry by airing another second of her show.

Even in the Age of Trump, there are red lines that can never be crossed. This is one. — Joe Scarborough (@JoeNBC) May 29, 2018

Tim Miller, spokesman for Jeb Bush’s presidential campaign, wrote, “It’s weird how Real American Anti-PC Warriors who are shining a light on out of touch elites keep calling black people apes.”

It’s weird how Real American Anti-PC Warriors who are shining a light on out of touch elites keep calling black people apes. — Tim Miller (@Timodc) May 29, 2018

Others pointed to the way that Walt Disney Co.-unit ESPN responded to the controversy over Jemele Hill, who was suspended for a series of tweets in which she called President Trump a white supremacist and later suggested a boycott of advertisers of the Dallas Cowboys.

She responded on Twitter on Tuesday, “Please God let me mind my business today.”