President Trump on Monday nominated Judge Brett M. Kavanaugh, a politically connected member of Washington’s conservative legal establishment, to fill Justice Anthony M. Kennedy’s seat on the Supreme Court, setting up an epic confirmation battle and potentially cementing the court’s rightward tilt for a generation.

Presenting Judge Kavanaugh at the White House, the president described him as “one of the finest and sharpest legal minds in our time,” and declared him a jurist who would set aside his political views and apply the Constitution “as written.”

The nomination of Judge Kavanaugh, 53, a federal appeals court judge, former aide to President George W. Bush and onetime investigator of President Bill Clinton, was not a big surprise, given his conservative record, elite credentials and deep ties among the Republican legal groups that have advanced conservatives for the federal bench.

But his selection most likely will galvanize Democrats and Republicans in the months before the midterm elections. Moments after the announcement, the Senate Democratic leader, Chuck Schumer of New York, declared, “I will oppose Judge Kavanaugh’s nomination with everything I have.” Senator Mitch McConnell of Kentucky had expressed misgivings about his path to confirmation, but said he was a “superb choice.”