Vermont Sen. Bernie Sanders almost challenged former President Barack Obama in 2012 and once chided him for negotiating with Republicans on core issues.

Sanders, who is now running for president, reportedly told several people, including fellow Vermont Sen. Patrick Leahy, that he was frustrated with Obama's performance in office and seriously considered challenging him in the 2012 Democratic primary. The Atlantic reports that Leahy, concerned by Sanders's comment, relayed the news to Obama's former campaign manager, Jim Messina.

The Obama campaign team “absolutely panicked” at Leahy's disclosure, as Messina told it, as “every president who has gotten a real primary has lost a general [election].”

David Plouffe, a former strategist for Obama, confirmed the team's concern to the Atlantic. In response, Messina called former Senate Majority Leader Harry Reid, who reportedly asked Sanders, "What could you be thinking? You need to stop." Reid eventually convinced Sanders not to challenge the incumbent president after two conversations in the summer of 2011.

Sanders's relationship with Obama was rocky over the years. In 2008, the Vermont socialist did not endorse Obama until he had secured the Democratic nomination for president, though the eventual president had won Vermont with 59% of the vote. In 2011, Sanders expressed disapproval with Obama's performance as president while on Thom Hartmann's radio show, accusing him of failing to live up to his campaign promises.

“There are millions of Americans who are deeply disappointed in the president — who believe that, with regard to Social Security and a number of other issues, he said one thing as a candidate and is doing something very much else as a president, who cannot believe how weak he has been, for whatever reason, in negotiating with Republicans; and there’s deep disappointment," Sanders said.

After making those comments, Sanders demanded that Obama do more to "stand up for the middle class."

"They want the president to stand up for the middle class, for the working class of this country, and they want him to take on big-money interests in a way that he has not done up to this point," the senator said.

A representative for Reid told the Atlantic that he "won't get into private conversations" but did not deny that Reid spoke to Sanders to persuade him not to run.

Sanders ran unsuccessfully for the Democratic presidential nomination in 2016 and is a leading candidate this election cycle. Obama has yet to make an endorsement.

The Washington Examiner reached out to the Sanders campaign for comment but did not immediately receive a response before publication.