Senate Majority Leader Mitch McConnell (R-Ky.) withdrew President Trump’s nomination of Ryan Bounds to serve on the Ninth Circuit Court of Appeals just moments before his candidacy was set for a confirmation vote on Thursday due to racially insensitive past writings.

Why it matters: The move is a major win for Democrats and a blow to the GOP's ongoing transformation of the federal bench with young, conservative judges at a near-unprecedented pace.

The details: McConnell made his decision after some Republicans signaled their opposition due to Bounds’ past writings that denigrated multiculturalism and race-focused groups and questioned the value of cultural sensitivity training, per the Washington Post.

How it happened: Sources familiar with the matter told Politico's Burgess Everett that McConnell made the decision after Sen. Tim Scott (R-S.C.), the only African-American member of Senate GOP conference, flagged Bounds’ past writings to Sen. Marco Rubio (R-Fla.), who sided with Scott against the nominee. Scott then met with McConnell to voice his concerns and GOP lunch, which prompted other Republicans to help sink the nomination, per Politico.

However, Democrats had long opposed Bounds, who would have been Trump’s 24th Circuit Court nominee. At a contentious confirmation hearing before the Senate Judiciary Committee in May, he apologized for some of his undergrad writings and told Democratic lawmakers that his rhetoric was “overheated” at the time, WashPost said.

Advancing a judicial nomination in the Senate only requires a simple majority. All 49 Senate Democrats had voted Wednesday to block Bounds' nomination, while 50 Republicans moved to advance it (except for Sen. John McCain, who's absent). But by Thursday morning, the nomination didn't have the votes to pass.

Flashback: This is not the first judicial pick from Trump to have his nomination pulled over controversial records. Last year, the White House was forced to drop the nominations of Brett Talley and Jeff Mateer over past controversial remarks.

In a speech on religion and homosexuality, Mateer said transgender children are part of "Satan's plan" and advocated for gay conversion.

Talley had been criticized for a blog post he wrote about Barack Obama and gun control following the Sandy Hook shooting. And in a 2011 online post, he defended “the first KKK.”

Go deeper: How Trump is reshaping the courts.