ABC canceled its top-rated comedy "Roseanne" on Tuesday in a stunning move that came just hours after the show's star Roseanne Barr posted a racist tweet about Valerie Jarrett, the former aide to President Obama.

"Roseanne's Twitter statement is abhorrent, repugnant and inconsistent with our values, and we have decided to cancel her show," ABC Entertainment President Channing Dungey said in a statement announcing the end of the "Roseanne" reboot, a politically tinged show and ratings monster.

Roseanne Barr, a 65-year-old comedian and staunch Trump defender, had written that the ex-White House adviser was the child of the Islamist organization Muslim Brotherhood and the movie "Planet of the Apes."

"Muslim brotherhood & planet of the apes had a baby=vj," Barr wrote on Tuesday morning, using Jarrett's initials. The message was in response to a tweet accusing Jarrett of helping to "hide" misdeeds by the Obama administration.

Barr later apologized to Jarrett and the public, deleting the tweet and saying she was "leaving Twitter," but that wasn't enough to prevent the cancellation of her show, which had been cheered by President Trump over the title character's support of his administration.

The March "Roseanne" premiere reportedly averaged 18.1 million viewers, the highest-rated regularly scheduled scripted show of the last few seasons.

It made headlines for its lead character's defense of Trump, who publicly cheered the show's "unbelievable" ratings and personally called Barr to congratulate her.

"Look at Roseanne. Look at her ratings," Trump said during a March speech in Ohio focused on infrastructure.

"Over 18 million people [watched] - and it was about us!" Trump told the crowd. "The fake news hasn't quite figured it out ... but they will."

During the 2016 presidential campaign, Barr said that "we would be so lucky if Trump won," but she laughed off the idea that he had anything to do with the show's success.

"It's all me!" Barr told TMZ in April.

The White House didn't return ITK's request for comment about ABC's decision to pull the plug on "Roseanne."

ABC choosing to ditch its ratings winner could prove to be a huge blow for the network, which saw its audience numbers take flight with the politically charged revamp.

The show - which originally aired from 1988 to 1997 - was such a ratings smash that ABC had already announced it had been picked up for a second season in the fall.

But the damage to the network's image from associating with Barr could also have been substantial.

ABC's cancellation followed public expressions of dismay from "Roseanne" cast and crew members over the Jarrett tweet.

Wanda Sykes, who had served as a consulting producer on the sitcom, announced she wouldn't be returning.

Sara Gilbert, who starred as one of Barr's daughters on the series and served as an executive producer, also distanced herself from the sitcom's matriarch.

"This is incredibly sad and difficult for all of us," Gilbert tweeted, before ABC announced "Roseanne" wouldn't be returning for a second season.

Jarrett responded to the controversy on Tuesday, saying at a town hall focused on racism that the fallout from Barr's tweet should be turned into "a teaching moment."

"I'm fine," Jarrett said in a preview clip released by MSNBC. "I'm worried about all the people out there who don't have a circle of friends and followers who come right to their defense."

Barr, who in 2012 made her own White House bid as the Peace and Freedom Party's candidate, has been a lightning rod for controversy in the past. She garnered headlines in 1990 when she made an obscene gesture after delivering an ear-splitting rendition of the national anthem - which then-President George H.W. Bush blasted as "disgraceful" - at a nationally televised baseball game.

Earlier this year, photos resurfaced of Barr dressed as Adolf Hitler taking a batch of cookies shaped like children out of an oven. The 2009 photos reportedly appeared in a satirical Jewish magazine.

Barr defended the images in an interview, saying of her critics, "I don't give a f--- what people think. I care what people do. I don't care what they think."

The comedian also faced backlash in recent months for tweeting conspiracy theories, including in March the "Pizzagate" theory, which falsely alleged the existence of a child sex-trafficking ring linked to rogue elements in the government tied to Hillary Clinton and the Democratic Party.

While the Jarrett remark was widely condemned, some knocked ABC for the prompt decision to nix the series.

"I understand them using this as an excuse," 2012 GOP presidential candidate Herman Cain said of ABC in a Tuesday appearance on Fox Business Network.

"Yes, it was racist," Cain said in an interview with Trish Regan. "Yes, it was distasteful. And she vehemently apologized."

"I believe that forces within ABC didn't like the fact that her conservative defense of certain things was so popular and getting such ratings," Cain said.

The move by ABC to end its ratings juggernaut was applauded by the NAACP and at least one lawmaker.

Rep. John Lewis (D-Ga.) thanked ABC, writing on Twitter that the network "did the right thing."

"There is not any room in our society for racism or bigotry," the civil rights icon said.

"Roseanne Barr's comments were appalling and reminiscent of [a] horrific time in our history when racism was not only acceptable but promoted by Hollywood," NAACP President and CEO Derrick Johnson said in a statement.

Barr herself had preached acceptance of differing political views in an interview earlier this year.

"The idea that people can agree to disagree is kind of missing from everything," Barr told The Hollywood Reporter in March.

-Updated at 5:24 p.m.