The Farr defeat comes just days after Representative Mia Love, the only female black Republican in the House, conceded her failed re-election campaign by blasting her party for ignoring the nation’s minorities.

Mr. Scott said on Thursday that he was ultimately too troubled by Mr. Farr’s involvement in one of former Senator Jesse Helms’s racially tinged campaigns. The senator cited a Justice Department memo published this week by The Washington Post detailing an investigation the department launched into the campaign in 1992. The department accused Mr. Helms of intimidating black voters by sending out postcards that suggested they were not eligible to vote and that they could be prosecuted for fraud if they tried.

“Weighing these important factors, this afternoon I concluded that I could not support Mr. Farr’s nomination,” Mr. Scott said.

Mr. Farr’s defeat is a win for Democrats who, emboldened by an unusual set of circumstances and infuriated by Mr. Farr’s résumé, had mounted an aggressive campaign against him.

“Senator Tim Scott has done a courageous thing, and he’s done the right thing,” said Senator Chuck Schumer of New York, the Democratic leader. “Thomas Farr has been involved in the sordid practice of voter suppression for decades and never should have been nominated, let alone confirmed to the bench. Thankfully, he won’t be.”