"When President Obama was running for re-election, I was glad to step up and work very hard for him while Senator Sanders was trying to find someone to primary him," O'Malley told moderator Rachel Maddow at MSNBC’s First in the South Presidential Candidates Forum in South Carolina.

ADVERTISEMENT

"I am a Democrat. I am a lifelong Democrat," O'Malley added in a swipe at Sanders' recent conversion to the Democratic Party in time for the presidential campaign.

"I'm not a former independent. I believe in the party of Franklin Roosevelt," he said to a cheering crowd.

Sanders has represented Vermont in Congress as an Independent since 1991, although he caucuses with Democrats.

In 2012, when Obama was readying for his re-election bid, Sanders said a primary challenge to Obama would be “good idea for our democracy and for the Democratic Party.”

Sanders is significantly ahead of O’Malley in the 2016 Democratic presidential race, although both trail Hillary Clinton by a large margin.