Bernie Sanders said he will not allow Donald Trump to become US president - but refused to withdraw from the Democratic race.

Despite his rival Hillary Clinton declaring victory and holding a near insurmountable lead in the delegate count, Sanders vowed to "continue the fight" all the way to the party's convention in July.

The Vermont senator has faced growing calls to end his campaign and urge his supporters to rally behind Clinton ahead of her showdown with Trump in November's election.

Hillary Clinton with her husband and former president Bill Clinton. Credit: Reuters

But he ignored those calls, telling a crowd in California that he will continue to "fight for every vote".

Some Sanders fans are known to be contemplating switching their allegiance to Trump if Clinton is the Democratic candidate.

And the mammoth task Clinton has in winning over his fans was evident when the crowd booed her name after Sanders said he had congratulated her on her primary victories.

Sanders said stopping right-wing Republicans - "especially Donald Trump" - was fundamental to his campaign.

But he said his "mission" was more than just defeating the tycoon - it was about "transforming our country".

"Thank you all - the struggle continues," Sanders said at the end of his speech.