The show’s hosts grilled the president’s son about his tweets and the impeachment inquiry into his father. He accused them of wearing blackface and being soft on pedophilia.

Credit...Lou Rocco/Walt Disney Television

An appearance by Donald Trump Jr. on ABC’s “The View” to promote his new book quickly spiraled out of control on Thursday as he and the show’s politically outspoken hosts traded shouts and accusations that spilled over into the partisan echo chamber of social media.

Mr. Trump and his girlfriend, the Fox News host turned Trump campaign adviser Kimberly Guilfoyle, went on the show to discuss his book, “Triggered: How the Left Thrives on Hate and Wants to Silence Us.”

But the interview went off the rails when the hosts assailed him for sharing a Breitbart article on Twitter on Wednesday that claimed to name the whistle-blower whose complaint set off the House impeachment inquiry.

[Read the latest impeachment updates.]

“I don’t regret doing that,” Mr. Trump said. “I don’t think I should have to forgo my First Amendment rights. It’s out there, I read it in an article, I’ve been reading it for a week, I saw it on the Drudge Report. This is not some secret.”

The whistle-blower’s lawyer has declined to identify his client, and the person’s identity has not been independently verified. When some in the audience clapped for Mr. Trump’s response, the host Joy Behar chastised them.

“This is not a MAGA rally,” she said, referring to President Trump’s 2016 campaign slogan, “Make America Great Again.”

Mr. Trump soon went on the attack: He accused ABC of covering up for Jeffrey Epstein, the disgraced financier and sex offender who died by suicide in a New York jail cell this year; he claimed that another host, Whoopi Goldberg, was an apologist for the filmmaker Roman Polanski, who pleaded guilty to a sexual assault charge involving a 13-year-old girl in 1977; and he accused Ms. Behar, who is white, of once wearing blackface.

“I did not go in blackface, please,” Ms. Behar said.

“No, she was not in blackface,” Ms. Goldberg agreed.

Each of these accusations was picked up by Mr. Trump’s allies in the conservative media ecosystem, who sliced the interview into shareable video clips and spread them far and wide. If the point of going on “The View” was to generate content for conservative meme makers, then it appeared to have been a rousing success.

Shortly after the segment aired, Ms. Guilfoyle was celebrating on Twitter, where she took a new 2020 hashtag out for a spin. It stands for “Keep America Great.”

“We had the ladies of @TheView absolutely TRIGGERED! Hah! Proud to stand with @DonaldJTrumpJr, @realDonaldTrump, and the entire Trump family,” she wrote. “America loves the Trumps! #KAG2020.”

The blackface accusation against Ms. Behar appeared to quickly gain traction thanks to The Daily Wire, a conservative site that posted an undated video from an earlier season of “The View” that showed Ms. Behar talking about a Halloween costume for which she darkened her skin.

The site, founded by the conservative personality Ben Shapiro, tweeted the undated clip alongside a video of the exchange between Ms. Behar and Mr. Trump on Thursday. The website Jezebel wrote about the clip in 2016, saying then that it had appeared on the show recently.

In the undated clip, Ms. Behar and an earlier cast of hosts, which included the actress Raven-Symoné, are looking at a picture of Ms. Behar in a costume she described as “a beautiful African woman.” Raven, as the former child star is known, is the only African-American person on the stage, and she seems uncomfortable.

“Why are you upset with me now?” Ms. Behar asks.

“I thought that was — did you have tanning lotion on, Joy?” Raven asks.

“I had makeup that was a little darker than my skin,” Ms. Behar replies.

Brad Parscale, the campaign manager for President Trump’s re-election bid, shared The Daily Wire’s video on Twitter along with another clip of the younger Mr. Trump sparring with Ms. Behar.

“Love seeing @DonaldJTrumpJr TRIGGER @JoyVBehar to the point of explosion!” he wrote.

One tense segment of the show, however, was not as quickly turned into a meme by the president’s allies: an exchange between Mr. Trump and the conservative “View” host Meghan McCain, whose father, Senator John McCain, Republican of Arizona, was mocked by President Trump both before and after his death last year. Mr. McCain was the party’s presidential nominee in 2008.

“You and your family have hurt a lot of people and have put a lot of people through a lot of pain, including the Khan family, who is a Gold Star family that I think should be respected for the loss of their son,” Ms. McCain said, referring to the Trumps’ attacks on the parents of a fallen Muslim American soldier. “Does all of that make you feel good?”

“I don’t think any of that makes me feel good, but I do think we got into this because we wanted to do what is right for America,” Mr. Trump replied. He then talked about his father’s efforts to “bring back the American dream” and repeated a common refrain among Trump supporters: that the president is “a counterpuncher” who is unafraid to take the fight to liberals. As he responded to Ms. McCain, another host, Sunny Hostin, jumped in.

“I don’t think she appreciates that your father attacked her father,” she said.

“I understand that, and I am sorry about that and they did have differences, I agree with that,” Mr. Trump said. He offered his condolences to Ms. McCain on the death of her aunt. She thanked him and turned back to her original question.

“Inflicting pain on so many people would not have been worth it to me or my family, for the White House,” she said. “So I just want to know, is it worth it?”

Mr. Trump responded by portraying himself as a victim of his father’s unpopularity in New York City, their hometown.

“It depends on the hat that I am wearing,” he replied. “As the father of kids in New York City, it has not been exactly peaches and cream for us.”