Consumer sentiment climbed to a seven-month high in October, as confidence surged among Republicans anticipating a Donald Trump victory in the fast-approaching presidential election, according to data released Friday by the University of Michigan.

The university’s index of consumer sentiment climbed to 70.5 in early October, up from 70.1 in September, marking the highest level since April. The uptick reflects a sharp rise in optimism among Republicans, even as confidence among Democrats saw a slight dip.

“Sentiment of Republicans, who believe that a Trump presidency would be better for the economy, rose eight percent on growing confidence that their preferred candidate would be the next president,” said Joanne Hsu, the director of the survey.

With less than two weeks until Election Day, the race between former President Trump and Vice President Kamala Harris remains intensely competitive, with both sides gearing up for a final push in what has been one of the most closely contested elections in recent history. Polls from the Wall Street Journal and the New York Times this week showed that Trump is slightly ahead in the national vote, a big shift from earlier polls that had Harris ahead. A win by Trump in the national popular vote would guarantee him a win in the electoral college and make him the next president of the United States.

This is a major reversal from a month ago, when consumer sentiment rose on Democrat electoral hopes. Sentiment among Democrats climbed in September but fell among independents and Republicans.

Despite the recent increase, consumer sentiment remains well below its 2021 peak of 88.3, suggesting that overall confidence is still subdued in the face of lingering economic uncertainties. Remarkably, consumer sentiment is even lower now than it was in the worst months of the pandemic. Prior to the onset of the pandemic, when Trump was president, consumer sentiment was regularly near or above 100.

The index of current economic conditions rose to 64.9 in October, driven by a big surge in Republican sentiment. Democrat sentiment declined and independents moved up moderately. The index of consumer expectations fell slightly in the month, due to a decline among Democrats. Sentiment among independents and Republicans about the future rose slightly.