President Donald Trump's closing message to voters before the midterm elections on Tuesday has offended so many that the three major cable news networks and the world's largest social-media site have all refused to carry it.

As part of a scorched-earth strategy in the final days before the momentous midterm elections, Trump's 2020 reelection campaign released an ad widely viewed as a racist attack on immigrants.

The media's unified decision to reject the president's ad is virtually unprecedented.

President Donald Trump's closing message to voters before the midterm elections on Tuesday has offended so many that the three major cable news networks — including the president's favored outlet — and the world's largest social-media site have all refused to carry it.

As part of a scorched-earth strategy in the final days before the momentous midterm elections, Trump's 2020 reelection campaign released an ad widely viewed as a racist attack on immigrants.

The ad asserts that Democrats allowed Luis Bracamontes, an undocumented Mexican immigrant who was convicted of killing two police officers in 2014, into the country and warns that a so-called migrant caravan now traveling through Mexico to the US border includes similar criminals.

The fearmongering ad is both factually misleading — Bracamontes entered the country under Democratic and Republican administrations — and offensive, painting a group of thousands of Central American migrants, who are fleeing poverty and violence in their home countries, as dangerous criminals without evidence.

CNN refused to run the TV spot, calling it "racist."

But NBC aired the 30-second ad during Sunday evening's primetime NFL game between the New England Patriots and the Green Bay Packers — the most watched game in the 13-year history of "Sunday Night Football," with an average of 21 million viewers.

Trump promoted a longer version of the ad on his Twitter feed last week, prompting immediate and widespread denunciation and comparisons to the infamous "Willie Horton" ads that ran in support of former President George H.W. Bush's 1988 presidential bid.

Some of NBC's top talent — including the director Judd Apatow and the "Will and Grace" star Debra Messing — bashed the decision on social media.

Racist champions of Trump celebrated the message.

"Go Trump Go! Your Midterm Ad is a masterpiece personifying the insanity of our immigration Policy," David Duke, a white supremacist and former Ku Klux Klan leader, said of the ad. "Bravo Trump!"

Democrats slammed the ad as the latest example of Trump leveraging bigotry to motivate his base.

"No one [should] be surprised that the guy who fueled his rise to power on the birther movement is now deploying the next phase of white nationalism to fuel the election of his most loyal Republicans," Jesse Ferguson, a Democratic strategist and former spokesman for Hillary Clinton, told Business Insider.

NBC soon pulled the ad, and Fox News followed.

"After further review we recognize the insensitive nature of the ad and have decided to cease airing it across our properties as soon as possible," an NBC spokesman told Business Insider.

By midday on Monday, the major cable news networks and Facebook had all pulled the president's ad — a virtually unprecedented move. (Facebook continued to allow users to post the contents of the ad.)

Fox's decision to pull the spot — which it aired six times on Fox News and eight times on Fox Business, according to a media analyst — took many by surprise and reinforced the perception that the Trump campaign had gone too far.

"The President produced an ad that was so offensive that the cable network he openly promotes won't even air it. Where we are as a country," said Brendan Nyhan, a professor of public policy at the University of Michigan.

Even Republicans who argued that the ad wouldn't much affect Tuesday's elections said they found its contents distasteful.

"I don't think it matters that much since it came so late," Matt Mackowiak, a GOP strategist based in Texas, told Business Insider of the ad's potential effect on voters. "I wish the Trump campaign had been far more careful. They do not have to go overboard. The contrast on sanctuary cities, border security, and interior enforcement is stark enough."