Roseanne Barr has apologised to former Obama White House adviser Valerie Jarrett for comparing her to an ape and linking her to the Muslim Brotherhood.

The TV star said she was leaving Twitter after sparking controversy with the post, which she has since deleted.

In a response to a thread alleging Jarrett helped to conceal CIA spying, Barr wrote that the black adviser was the “baby” of the Muslim Brotherhood and Planet Of The Apes.

Barr later wrote on Twitter: “I apologize. I am now leaving Twitter.”

She added: “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.”

Her tweet about Jarrett had prompted users to point out the tweet was racist, with Barr replying: “Muslims r NOT a race.”

She told another follower: “It’s a joke.”

In another string of tweets, Barr connected Chelsea Clinton, daughter of Bill and Hillary, to Democratic donor George Soros.

She also retweeted people calling for the release of former English Defence League leader Tommy Robinson, who has been sentenced for contempt of court.