US President Barack Obama has ridiculed the Republican establishment for being “shocked” by the rise of Donald Trump to the GOP presidential frontrunner.

“What’s happening in this primary is just a distillation of what’s been happening in their party for more than a decade,” Obama said Friday at a fundraiser for the Democratic National Committee in Austin, Texas.

Republican leaders have expressed frustration with Trump’s growing momentum on the campaign trail and are urgently moving to prevent the billionaire businessman from securing the party’s nomination.

Obama said Republicans should have predicted the rise of Trump, and accused them of ignoring his past.

The president blistered the GOP for acting surprised that “someone is fanning anti-immigrant or anti-Muslim sentiment.”

“How could you be shocked?” Obama exclaimed. “This was the guy who was sure I was born in Kenya. Who just wouldn’t let it go. And all this same Republican establishment, they weren’t saying nothing. As long as it was directed at me, they were fine with it. They thought it was a hoot. Wanted to get his endorsement.”

Donald Trump speaks to supporters during a rally at the Peabody Opera House on March 11, 2016 in St. Louis, Missouri. (AFP photo)

Obama argued that this kind of “gambling” inside the Republican establishment has now come to haunt it with the rise of a candidate who is “loose with the facts” and “distorts someone’s record.”

“So they can’t be surprised when somebody suddenly looks and says, you know what, I can do that even better. I can make stuff up better than that. I can be more outrageous than that. I can insult people even better than that. I can be even more uncivil,” he noted.

Obama, on several occasions, has weighed in on Trump’s candidacy, urging the American people to be careful who they will pick to succeed him into the White House.

Trump’s campaign has been defined by controversy since he announced his candidacy in June last year, making divisive and disparaging remakes about women, immigrants, Muslims and others.

Demonstrators react after learning a rally for Donald Trump at the University of Illinois at Chicago would be postponed on March 11, 2016 in Chicago, Illinois. (AFP photo)

The candidate had to cancel his rally event in Chicago, Illinois, on Friday after his supporters came to blows with a group of protesters slamming his candidacy.

The clashes erupted when Trump campaign managers asked thousands of his supporters at the University of Illinois to leave the arena due to security concerns.

The angry rally-goers gathered inside and outside the arena and then confronted several hundred anti-Trump protesters, blaming them for the cancellation.

Several fistfights were reported between the two groups before a large contingent of Chicago police officers moved in to restore order.