WASHINGTON — Days after Senate Republicans installed Justice Brett Kavanaugh on the Supreme Court, President Trump and Majority Leader Mitch McConnell huddled at the White House to review private polling that showed a Republican surge triggered by the polarizing nomination.

Trump wondered aloud at the Oct. 9 meeting: How do we keep this going? McConnell, R-Ky., replied that there was only one person who could do it: the president himself.

Since that conversation, which was confirmed by three people with knowledge of the session, Trump has held a series of rallies in Senate battleground states – with plans for at least 10 in the final six days of the campaign up and down the ballot – and Republicans have grown increasingly confident about their prospects in the Nov. 6 midterm elections.

McConnell has been telling associates that Republicans are in a strong position to hold the Senate and could pad their narrow 51-to-49 advantage by a couple of seats, according to people familiar with the talks, though the Kentuckian avoids precise predictions.

The optimism marks a shift from early September, when officials were fretting over struggling candidates and contemplating the possibility of losing both chambers of Congress.

Although Republicans still feel like underdogs to hold the House amid anger with Trump, especially in the suburbs, they believe they have energized enough voters in Trump-friendly regions to keep the Senate, thanks to an uptick in the president’s popularity and Republican outrage with Democratic efforts to prevent the confirmation of Kavanaugh, who was accused of sexual misconduct.

“It looked pretty bad a few weeks ago, but I think it’s looking better for us,” said Sen. Orrin Hatch, R-Utah.

Republicans say they are well positioned to pick up a seat in North Dakota and are closing in on another one in Missouri, where polls show a close race. Republican strategists also think they have gained the advantage in Texas and Tennessee. But struggles in the Upper Midwest and fresh worries about Florida have raised questions about how many more states they can add.