ABC canceled its hit sitcom "Roseanne" on Tuesday after the show's biggest star, Roseanne Barr, went on a racist Twitter rant.

"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.

Disney CEO Bob Iger added on Twitter that "there was only one thing to do here, and that was the right thing."

The cancellation stunned Hollywood. Industry veterans said they've never seen anything quite like it. The revival of "Roseanne" premiered to huge ratings just three months ago. Pre-production was already underway on a second season, which was scheduled for Tuesdays at 8 p.m. this fall.

But now the show is over. ABC was planning to air a repeat of "Roseanne" Tuesday night, but a rerun of "The Middle" will air in its place.

Barr's talent agency, ICM Partners, also dropped her on Tuesday. "What she wrote is antithetical to our core values, both as individuals and as an agency," the agency said in a statement. "Consequently, we have notified her that we will not represent her. Effective immediately, Roseanne Barr is no longer a client."

Related: The inside story of how ABC fired Roseanne Barr

On Tuesday evening, Barr tweeted an apology to the show's cast and crew.

"Don't feel sorry for me, guys!!-I just want to apologize to the hundreds of people, and wonderful writers (all liberal) and talented actors who lost their jobs on my show due to my stupid tweet," she said.

Barr also said that she would appear on comedian Joe Rogan's podcast on Friday.

Don't feel sorry for me, guys!!-I just want to apologize to the hundreds of people,and wonderful writers (all liberal) and talented actors who lost their jobs on my show due to my stupid tweet. I will be on Joe Rogan's podcast friday. — Roseanne Barr (@therealroseanne) May 30, 2018

Barr has a long history of controversial tweets, including posts about pro-Trump conspiracy theories. But even by her low standards, Tuesday's remarks were egregious.

"Beyond the pale" is how one Disney (DIS) source put it.

In a series of tweets, Barr attacked Valerie Jarrett, Chelsea Clinton and George Soros.

ABC went silent for several hours as it decided what to do. While it took some time to announce the decision, executives pretty quickly decided to boot the reboot.

When asked why ABC ultimately decided to cancel the show, a Disney source said, "It's a question of right and wrong. And it's a question of our company's values."

Related: The ABC executive who fired Roseanne hired her last year

Reactions to the decision were overwhelming and largely positive.

Congressman John Lewis thanked ABC, saying that "There is not any room in our society for racism or bigotry."

"Some things apparently are more important than money," even for a network like ABC, "and that's heartening," CNN's Van Jones said on the air.

But there will be ripple effects from the cancellation. At least 200 jobs will be affected, according to industry sources.

Before ABC pulled the plug, some of Barr's colleagues had publicly rebuked her.

Actress Emma Kenney, who played Roseanne's granddaughter on the reboot, tweeted that she was in the process of quitting the show when she found out that it had been canceled.

About an hour and a half before the cancellation was announced one of the show's consulting producers, Wanda Sykes, said she was done with it. "I will not be returning to @RoseanneOnABC," Sykes tweeted.

And Sara Gilbert, who plays Barr's daughter on the ABC sitcom, tweeted that Barr's comments are "abhorrent and do not reflect the beliefs of our cast and crew or anyone associated with our show."

Gilbert added: "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."

What Barr said on Twitter

In one of the tweets, she wrote, "Muslim brotherhood & planet of the apes had a baby=vj."

Barr was responding to a comment about Valerie Jarrett, a top former aide to President Obama.

She claimed she was joking, but then she deleted the tweet and issued an apology to Jarrett and "all Americans."

"I am truly sorry for making a bad joke about her politics and her looks," Barr tweeted. "I should have known better. Forgive me -- my joke was in bad taste." Barr then said she's leaving Twitter.

Jarrett told MSNBC later on Tuesday that "we have to turn [this episode] into a teaching moment."

Social media lit up with criticism of both Barr and ABC, with some demanding a response from the broadcast network.

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

Barr also targeted Chelsea Clinton by calling her "Chelsea Soros Clinton." She later replied in the comments that Clinton is "married to Soros nephew." Soros is a billionaire liberal benefactor who has been the villain in many right-wing conspiracy theories over the years.

Chelsea Soros Clinton — Roseanne Barr (@therealroseanne) May 29, 2018

Clinton responded and corrected Barr.

"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," she wrote.

Barr responded back to Clinton saying, "Sorry to have tweeted incorrect info about you! Please forgive me!"

But she then continued, "By the way, George Soros is a nazi who turned in his fellow Jews 2 be murdered in German concentration camps & stole their wealth-were you aware of that? But, we all make mistakes, right Chelsea?"

This is a hateful conspiracy theory about Soros that has been debunked many times. The fact-checking site Snopes called it "false" back in 2016.

Why ABC revived "Roseanne"

In the past, ABC executives have privately said that they held their noses when Barr tweeted. They knew some of her posts had been problematic and they had urged her to concentrate on the sitcom reboot.

But they essentially decided that the rewards of hiring Barr were outweighed by the potential risks.

For a while, they were right. The "Roseanne" revival was one of the highest-rated new shows of the season. About 18 million live viewers watched the premiere episode in March. Barr was restored as one of the network's biggest stars, just like she was twenty years ago.

Barr is a supporter of President Trump in real life and on the show. Trump praised the debut saying, "Over 18 million people! And it was about us!" He also called Barr to congratulate her.

Later, the show saw its audience come back down to earth, but its finale still nabbed roughly 10 million live viewers, a huge achievement for ABC.

Related: Why you've been seeing so many revivals of old TV shows

Just two weeks ago, Barr was the centerpiece of ABC's upfront presentation to advertisers in New York.

That's why it was hard to imagine "Roseanne" being cancelled when Tuesday began.

But Disney believed it had to take action. They were both cultural and financial factors to consider. It was clear that some major advertisers would likely shun "Roseanne" in the future.

"Enough was enough," the Disney source said.