"I apologize to Valerie Jarrett and to all Americans," Barr wrote on Twitter. "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."
ABC, which broadcasts Barr's sitcom "Roseanne," canceled the show later Tuesday, citing her tweet, calling it "abhorrent, repugnant and inconsistent with our values."
The tweet, which has since been removed from her feed, said: "muslim brotherhood & planet of the apes had a baby=vj," referring to Jarrett.
Here is a screenshot of the tweet taken before it was deleted:
Critics immediately slammed Barr's remark as racist. Likening black people to apes is an attack commonly used by racists. The Muslim Brotherhood, meanwhile, is an Islamist political group.
In an earlier tweet, the actress appeared to defend her statement. "ISLAM is not a RACE, lefties. Islam includes EVERY RACE of people," she wrote.
She also defended her remark about Jarrett as a joke, in a tweet to a CNN reporter.
The actress also said that she would be leaving Twitter. Her account was still active as of publication.
The sitcom "Roseanne" returned to television this year after an initial run in the 1980s and '90s. Its recent premiere shattered ratings records, although it has faced criticism for racially tinged humor. ABC is owned by Disney.
On Tuesday, consulting producer Wanda Sykes, who is black, announced on Twitter that she would not be returning to the show. She did not provide a reason, and could not immediately be reached by CNBC.
Sara Gilbert, who plays the daughter of Barr's character on the show, said she was "disappointed" in the star and called her comments "abhorrent."
Barr often makes politically charged and controversial statements on her Twitter feed. She is a supporter of President Donald Trump, who called her to congratulate her for the sitcom revival's high ratings.
"You can't control Roseanne Barr," Ben Sherwood, president of the Disney-ABC Television Group, told The New York Times in March. "Many who have tried have failed. She's the one and only."
A representative for Jarrett declined to comment.