ABC on Tuesday abruptly canceled top-rated show “Roseanne” after a series of racist tweets by its star, Roseanne Barr, bringing an end to one of Hollywood’s boldest efforts to reach out to red-state viewers in the Donald Trump era.

“Roseanne” was one of network television’s most successful but turbulent partnerships, producing a weekly parade of millions of viewers but also creating a host of headaches for the Disney-owned network. The show spurred debate over the title’s character support for President Trump and Barr’s history of incendiary statements.

The decision to cancel the sitcom came after Barr sent out a tweet late Monday referring to Barack Obama adviser Valerie Jarrett, who is black. The tweet read: “Muslim brotherhood & planet of the apes had a baby=vj.”

Barr soon apologized. “I am truly sorry for making a bad joke about her politics and her looks,” she wrote on Twitter. “I should have known better.”

But by early afternoon, ABC announced it had canceled the show, which was set to serve as the cornerstone of its fall schedule.

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

Added Disney chief Robert Iger: “There was only one thing to do here, and that was the right thing.”

Neither Dungey, the first African American woman to be entertainment president at one of the broadcast networks, nor Iger would comment further.

“Roseanne” had returned to television this year after a 21-year hiatus, bringing back its cast to portray a white working-class family grappling with the challenges of daily life — as well as questions of politics, economics and culture. ABC quickly renewed the show for another season, even as Barr herself remained a lightning rod on Twitter, often sharing conspiracy theories. 

Jarrett addressed the comments in a forum that was to air Tuesday night on MSNBC, saying that Disney chairman Bob Iger had called her before the announcement.

“This should be a teaching moment,” Jarrett said, according to an MSNBC preview of the session. “I’m fine. 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. ... Those ordinary examples of racism that happen every single day.”

The tweet about Jarrett was one of two inflammatory messages Barr posted on Twitter on Monday night. She also — falsely — wrote that Chelsea Clinton is married to George Soros’s nephew and added, “Soros is a Nazi who turned in his fellow Jews 2 be murdered in German concentration camps & stole their wealth” — a widely debunked conspiracy theory about the left-wing billionaire.

It wasn’t immediately clear if, before announcing the cancellation, ABC faced private blowback from advertisers regarding Barr’s Twitter messages. A handful of television personalities have been pushed off the air, either temporarily or permanently, after advertiser boycotts.

ABC had benefited in part from the attention Barr generated, as total viewership stayed above 10 million for every episode, extremely rare for a broadcast sitcom in the streaming age. At the network’s presentation earlier this month to advertisers in New York, Barr had even taken the stage and introduced Ben Sherwood, president of ABC Television, giving him a hug and joking that Sherwood wrote her tweets.

But on ABC’s lot in Burbank, Calif., some cringed that one of the network’s biggest moneymakers was also its greatest troublemaker, according to at least two people who work there but were not authorized to speak publicly.

In public comments, Dungey, the ABC Entertainment president, had sought to position the show as an attempt to bridge a gap between the American viewing public and the coastal power centers that determined its choices. But Barr’s provocative utterances, sometimes in the context of her Trump support, made that difficult.

The president had in fact early in the season called Barr to congratulate her on her ratings success, and she repaid the favor by saying that the compliment meant a lot because he was someone who understood about such things. 

For some in the political sphere, the “Roseanne” cancellation was a welcome piece of news.

“Thank you, @ABCNetwork. You did the right thing,” tweeted Rep. John Lewis (D-Ga.). “There is not any room in our society for racism or bigotry.”

Some on the far right criticized the cancellation as political correctness, but the broad reaction was support for ABC’s decision.

The lack of widespread criticism was notable for these culturally politicized times, with debates, for example, raging over the NFL’s decision to ban anthem kneeling, among other fraught subjects.

Many Hollywood personalities were quick to distance themselves from Barr. Wanda Sykes, a consulting producer, said she was leaving the show immediately after the Jarrett tweet posted.

Bruce Helford, who as showrunner essentially serves as on-set chief, released a statement that he was “personally horrified and saddened by the comments and in no way do they reflect the values of the people who worked so hard to make this the iconic show that it is.” 

Meanwhile, Barr was dropped by agency ICM Partners, with which she had signed just last summer ahead of her return to network television.

“We are all greatly distressed by the disgraceful and unacceptable tweet from Roseanne Barr this morning,” the agency said in a statement, sent to The Post after a request for comment from ICM chief Chris Silbermann. “What she wrote is antithetical to our core values, both as individuals and as an agency. Consequently, we have notified her that we will not represent her.” 

Sara Gilbert, an outspokenly liberal star and executive producer on the show, tweeted that Barr’s social-media remarks were “abhorrent and do not reflect the beliefs of our cast and crew.”

She said she was “disappointed” and noted the controversy was “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.”

The comments marked a reversal of Gilbert’s defense of her decision to work with Barr at the start of the season.

Asked at the time about how she felt about those who said the show was a vehicle for Trumpism, Gilbert said in an interview that “it’s not so much about the politics as it is about how the struggle of the working class is affecting families,” adding her decision to work with Barr was born of a desire for understanding.  

“Are you not supposed to talk to each other? All of us should be working together and talking to people of different views,” she said.