Former US President Barack Obama has kept pretty quiet about his successor Donald Trump ... until now.

Speaking to students at the University of Illinois, he launched a scathing attack on what he described as the "crazy stuff that is coming out of this White House" and the Republican Party itself.

“They’re undermining our alliances, cozying up to Russia," he said. "What happened to the Republican party? Its central organizing principle in foreign policy was the fight against communism, and now they’re cozying up to the former head of the KGB."

Normally former presidents don't attack from the sidelines but with mid-term elections just around the corner, Obama felt it was time to speak out on many issues, Including Trump's attacks on the press.

“It shouldn’t be Democratic or Republican to say that we don’t threaten the freedom of the press because they say things or publish stories we don’t like," he said. "I complained plenty about Fox News, but you never heard me threaten to shut them down or call them enemies of the people.”

President Trump was cutting in response when asked about the speech: "I watched it, but I fell asleep."

He also accused Obama of trying to take credit for things achieved under the current administration. It seems the mid-term elections are set to get very personal.