Former President Barack Obama speaks to students at the University of Illinois where he accepted the Paul H. Douglas Award for Ethics in Government on September 7, 2018 in Urbana, Illinois.

Former President Barack Obama on Friday warned Democratic primary candidates to avoid leaning too far left in their campaigns, and raised concerns that certain liberal policy proposals on health care and immigration might have gone further than public opinion.

In an unusual address to a room of wealthy Democratic donors, Obama urged Democratic candidates to be pragmatic in their messages to voters. While he didn't mention any specific presidential primary candidate or proposal, Obama warned that the average American voter does not align with views from "certain left-leaning Twitter feeds or the activist wing of our party."

Obama said that his concerns aren't a criticism of party activists, whose job he said is to "poke and prod and text and inspire and motivate." But he emphasized that whoever the candidate is, their ultimate job is to get elected.

"Even as we push the envelope and we are bold in our vision we also have to be rooted in reality," Obama said. "The average American doesn't think we have to completely tear down the system and remake it."

Obama's comments, made to the Democracy Alliance in Washington D.C., come as a large spread of candidates compete in the Democratic primary. The former president has mostly stayed quiet about the election, and has told allies that he and his wife have no plans to endorse anyone because they don't want to influence the election.

His statements could be seen as a nudge to Senators Bernie Sanders and Elizabeth Warren, who have championed large, progressive policies aimed to significantly change the structure of the country.

"I don't think we should be deluded into thinking that the resistance to certain approaches to things is simply because voters haven't heard a bold enough proposal and if they hear something as bold as possible then immediately that's going to activate them," he said.

Obama said candidates should "push past" his achievements as president, but embrace a message that will keep them competitive across all parts of the country.

"For those who get stressed about robust primaries, I just have to remind you I had a very robust primary," he told the donors. "I'm confident that at the end of the process we will have a candidate that has been tested."