(Reuters) - Former U.S. President Barack Obama assailed President Donald Trump and Republicans on Friday, urging Democrats to deliver a check on the administration’s “abuses of power” and restore a sense of sanity to politics by voting in November’s elections.

In an unusually blistering attack on his successor, Obama said Americans were living in dangerous times and accused Republicans of threatening democracy, dividing the country, undermining global alliances and cozying up to Russia.

“In two months we have the chance, not the certainty, but the chance to restore some semblance of sanity to our politics,” he said in a speech at the University of Illinois at Urbana-Champaign. “There is actually only one check on bad policy and abuses of power, and that’s you and your vote.”

Both parties are urging their core supporters to get to the polls for the Nov. 6 midterm elections, when Democrats need to pick up 23 seats in the House of Representatives and two seats in the Senate to gain majorities in Congress and slam the brakes on Trump’s agenda.

Obama, who had frustrated some Democrats by keeping a relatively low profile since leaving office in January 2017, accused Republicans of being unwilling to safeguard democracy or offer a check on Trump’s policies or worst instincts.

He said voters would have to do it instead.

“In the end, the threat to our democracy doesn’t just come from Donald Trump or the current batch of Republicans in Congress,” he said. “The biggest threat to our democracy is indifference. The biggest threat to our democracy is cynicism.”

Trump was dismissive of Obama’s speech.

“I’m sorry, I watched it but I fell asleep,” he said during a fundraiser in North Dakota. “I found that he’s very, very good for sleeping.”

Slideshow ( 5 images )

The November elections have been seen as a referendum on Trump, who has fulfilled campaign promises to cut taxes and regulations but who faces a widening special counsel probe of Russian interference in the 2016 presidential election and growing questions about his fitness for office, even by some within his administration.

Obama ridiculed Trump for taking credit for economic gains that began under Obama’s administration, and said Trump was exploiting cultural fears and economic anger that have grown in recent years amid societal upheavals.

“It did not start with Donald Trump. He is a symptom, not the cause,” Obama said. “He’s just capitalizing on resentments that politicians have been fanning for years.”

‘RESENTMENT AND PARANOIA’

Until now, Obama had been reluctant to criticize his successor publicly, although last week he appeared to chide Trump, without naming him, in a eulogy for the late Republican Senator John McCain.

But he dropped that political reticence in Illinois, the state where he launched his own political career, saying a vote against Republicans could restore “honesty and decency and lawfulness” to government.

“If you thought that elections don’t matter, I hope these last two years have corrected that impression,” he said. “The politics of division and resentment and paranoia has unfortunately found a home in the Republican Party.”

Republicans shrugged off Obama’s criticism.

Slideshow ( 5 images )

“In 2016, voters rejected President Obama’s policies and his dismissiveness towards half the country. Doubling down on that strategy won’t work in 2018 either,” said Republican National Committee spokesman Michael Ahrens.

If Democrats win control of one or both chambers in Congress in November, they would be able not just to stymie Trump’s agenda but to launch investigations of the Trump administration.

Trump told supporters in Montana on Thursday that Republicans needed to maintain control of Congress to stave off possible impeachment proceedings against him, although Democrats have played down any discussion of that approach.

“If it (impeachment) does happen, it’s your fault, because you didn’t go out to vote. OK? You didn’t go out to vote. You didn’t go out to vote. That’s the only way it could happen,” Trump told the rally.

Obama will hit the campaign trail on Saturday, appearing at a campaign event in southern California before heading to Ohio next week and to Illinois and Pennsylvania later in the month.

In August, Obama endorsed 81 Democratic contenders in 14 states, emphasizing young, diverse candidates running for state-level offices in an attempt to help new party leaders establish themselves.