(CNN) NBC and Fox News said in separate statements on Monday that their networks will no longer air the Trump campaign's racist anti-immigrant advertisement.

NBC was first to announce the change, doing so after a backlash over its decision to show the 30-second spot during "Sunday Night Football," one of the highest-rated programs on television.

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

Fox soon followed suit.

"Upon further review, Fox News pulled the ad yesterday and it will not appear on either Fox News Channel or Fox Business Network," ad sales president Marianne Gambelli told CNN in a statement.

The ad ran about a dozen times on Fox News and Fox Business, combined, before being pulled.

Facebook also came under scrutiny for letting the Trump campaign run the ad on its platform. On Monday afternoon the company said "this ad violates Facebook's advertising policy against sensational content so we are rejecting it. While the video is allowed to be posted on Facebook, it cannot receive paid distribution."

The ad was released by the Trump campaign late last week. It vilified the thousands of migrants walking toward the US southern border, wrongly portraying them as invaders and criminals. It seemed designed to stoke fear ahead of the midterm elections and increase Republican turnout.

CNN determined that the ad was racist and declined to sell airtime for it. But other networks agreed to sell the time.

Many viewers were stunned when it aired during "Sunday Night Football," which raked in 21 million viewers this week.

This week's game had a particularly big audience as it featured a highly-anticipated matchup between two of the league's premier quarterbacks, Tom Brady and Aaron Rodgers.

A spokesman for the NFL said the league played no role in the airing of Sunday's ad.

"The NFL has no approval rights regarding campaign ads," the spokesman said. "That falls to the network that is selling the advertising and airing the game."

Along with the NBC broadcast network, NBCUniversal allowed the ad to air multiple times on MSNBC before Monday's decision was made.

An NBC source said the ad was cleared by the broadcast network's standards and practices team. "We regret the decision that the ad ran at all," the source said, "and it will not air on any NBCUniversal property, locally or nationally."

Fox News did not explain why it pulled the ad. The 30-second spot was not only racist, it also contained factual inaccuracies, and it is not uncommon for networks to reject advertisements on such grounds.

Fox's decision was particularly surprising given the network's close proximity and friendly relationship with the White House.

Critics of the network say its hosts and commentators employ some of the same racist rhetoric and scare tactics that were used in the ad.

"How does Fox News square this with offering hours of the same racial fear-mongering in primetime to promote Trump (at no cost) on a nightly basis?" asked Jesse Lehrich, communications director for the progressive group Organizing for America and a former Hillary Clinton spokesman.

On Twitter, Brad Parscale, Trump's 2020 campaign manager, ignored the decision by Fox to pull the ad.

Instead, Parscale lambasted NBC, CNN, and Facebook and said the "#FakeNewsMedia" was "trying to control what you see and how you think."

A little while later, the president was asked about the controversy by a reporter. He said "I don't know about it. I mean, you're telling me something I don't know about." He added: "We have a lot of ads, and they certainly are effective based on the numbers we are seeing."

When asked about the offensive nature of the ad, Trump said, "Well, a lot of things are offensive. Your questions are offensive a lot of the times."

People familiar with the matter told CNN that the advertisement was not submitted to either CBS or ABC, so those networks didn't have to decide whether to sell the airtime or not.

CNN had to make the decision on Friday when the ad was submitted there.

The next day, Donald Trump Jr. complained on Twitter that CNN "refused to run" the advertisement.