President Trump abruptly withdrew his nomination of Ryan Bounds, a federal prosecutor in Oregon, to the Ninth U.S. Circuit Court of Appeals in San Francisco Thursday after last-minute objections by at least two Republican senators to Bounds’ racially inflammatory writings as a Stanford student in the 1990s.

Bounds had seemed headed for confirmation despite opposition from both of his home-state senators, Democrats Ron Wyden and Jeff Merkley. The Senate had voted 50-49 on Wednesday, along party lines, to allow his nomination to proceed to a final vote on Thursday.

But shortly before the scheduled vote, Sen. Tim Scott of South Carolina, the Senate’s only black Republican, told leaders he had concerns about Bounds’ college writings and was not prepared to vote for him.

Sen. Marco Rubio, R-Fla., also announced his opposition, and other Republicans were leaning in that direction, according to published reports. Senate Majority Leader Mitch McConnell, R-Ky., announced 45 minutes later that the nomination had been withdrawn.

Bounds had been recommended for the bench by a bipartisan commission in Oregon, but most of the commission members dropped their support after learning about his publications as a Stanford student.

The civil-rights group Alliance for Justice compiled some of Bounds’ writings as opinion editor of the Stanford Review, a conservative campus publication. They included essays in which he criticized “strident racial factions in the student body” and said that “race-focused groups” should not be on campus. He derided organizations that “divide up by race for their feel-good ethnic hoedowns” and observed that “white students, after all, seem to be doing all right without an Aryan Student Union.”

An October 1994 piece headlined, “Lo! A Pestilence Stalks Us” criticized the “sensitivity” of the lesbian and gay community about the vandalism of a gay-pride statue. He also mocked Latino students’ reaction to the dismissal of a high-ranking Latino administrator: “rivers of tears, epithets, hunger strikes, negative press for the university and the formulation of presidential committees to examine the ‘systematic insensitivity’ toward Chicanos at Stanford.”

Testifying to the Senate Judiciary Committee in May, Bounds apologized for his writings. Committee Chairman Charles Grassley, R-Iowa, said such long-ago college documents should not threaten his nomination.

Scott and Rubio are not Judiciary Committee members and reportedly said they were just learning about Bounds’ writings.

“These people have been rushed through,” said Carl Tobias, a University of Richmond law professor who monitors judicial appointments. “There hasn’t been sufficient vetting in the White House, sufficient vetting in the Senate.”

Trump has gained Senate confirmation of 23 appeals court nominees, but only one to the Ninth Circuit: Michael Bennett, a former Hawaii attorney general, approved this month with Democratic support.

Sen. Dianne Feinstein, D-Calif., the senior Democrat on the Judiciary Committee, said the episode also underscores the need for more information on Trump’s Supreme Court nominee, Brett Kavanaugh, a federal appeals court judge in Washington, D.C. Democrats have demanded documents from Kavanaugh’s years as a lawyer and staff secretary to President George W. Bush, particularly relating to the treatment of prisoners at the Guantanamo Bay detention camp.

“If Republicans agreed that Bounds is not qualified because of what he wrote in college, how could they possibly argue that material from Brett Kavanaugh’s time in the White House and as a political operative aren’t relevant?” Feinstein said.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter:@BobEgelko