For the fourth season of “The Apprentice,” Donald Trump searched for a gimmick to bolster ratings. His idea was simple if explosive — pit an all-white team against an all-black team.

“Do you like it?” he asked, previewing the concept on Howard Stern’s radio show in April 2005.

“Yes,” Stern said.

“Do you like it?” Trump asked Robin Quivers, the black co-host.

“Well,” she said, “I think you’re going to have a riot.”

That gave Trump no pause. “It would be the highest-rated show on television,” he exulted.

Long before he ignited a firestorm by telling four Democratic congresswomen of color to “go back” to their home countries, even though three were born in the United States and all are citizens, Trump sought to pit Americans against one another along racial lines.

Over decades in business, entertainment and now politics, Trump has approached America’s racial, ethnic and religious divisions opportunistically, not as the nation’s wounds to be healed but as openings to achieve his goals.

He was accused by government investigators in the 1970s of refusing to rent apartments to black tenants (he denied it but settled the case) and made a name for himself in the 1980s championing the death penalty for five black and Hispanic rape suspects who were later exonerated. He threatened to sell his Mar-a-Lago estate to the Unification Church in 1991 and unleash “thousands of Moonies” if city officials in Palm Beach, Fla., did not allow him to carve up his property.

Taking on competitors of his Atlantic City casinos, he questioned whether rival owners were really American Indians entitled to federal recognition — then later teamed up with another tribe when there was money to be made. With his eye on the White House, he opened a yearslong drive to convince Americans that President Barack Obama was really born in Africa.

His own campaign in 2016 was marked by slurs against Mexicans, a proposed Muslim ban and other furors. To deflect criticism, two campaign officials said they regularly positioned a supporter nicknamed “Michael the Black Man” so cameras would show him behind Trump at his rallies.

In the White House, Trump equated “both sides” of a white supremacist rally in Charlottesville, Va., referred to African nations as “shithole countries” and said Nigerian visitors to the United States would never “go back to their huts.”

Trump has insisted he is the “least racist person you have ever met” and over the years he has made friends with prominent black Americans, particularly sports and hip-hop stars. Just Friday, Trump spoke with rapper Kanye West and promised to intervene in the case of his fellow artist A$AP Rocky, who is being held in Sweden on an assault charge, and followed up by calling the Swedish prime minister on Saturday.

Some of Trump’s black friends defended him in recent days, saying his raw, politically incorrect approach was just bracing honesty about the reality of America and not motivated by hate.

“I have an advantage of knowing the president very well, and he’s not a racist and his comments are not racist,” Ben Carson, the secretary of housing and urban development and only black member of the Cabinet, said on Fox News. “But he loves the country very much and, you know, he has a feeling that those who represent the country should love it as well.”

Lynne Patton, a Trump family event planner now working in the administration, rejected accusations of racism. “Trump sees success and failure, not color, not race, not gender, not religion,” said Patton, who is black. “I’ve traveled the country with this family, I’ve had drinks with this family, I’ve been at their weddings, their baby showers, their bachelorette parties. I’ve never heard anyone say anything bigoted or racist in my life.”

And White House officials argue that actions speak louder than words. Unemployment among Hispanics and black Americans has fallen to record lows on Trump’s watch, they say, and the president signed legislation overhauling a criminal justice system tilted against people of color.

But the longer Trump spends on the stage, the more friends and former employees have concluded that he is more racist than they had admitted.

“Let me be clear: Donald Trump is a disgusting, filthy, petty racist and he is trying to start a race war in this country, and what we saw this week is just the beginning,” said Omarosa Manigault Newman, a former “Apprentice” star fired after a stint in the White House.

Anthony Scaramucci, who briefly served as White House communications director, wrote on Twitter that Trump would never have told a white immigrant to go back to his country. “That’s why the comments were racist and unacceptable,” he said, remarks that got him disinvited from a Republican fundraiser.