President Barack Obama and Bernie Sanders talked foreign policy, the economy and "a little bit of politics," Sanders said Wednesday after their first extended sit-down since the senator’s presidential campaign jolted the race for the Democratic nomination.

Talking to reporters in the White House driveway, Sanders acknowledged he and the president have had differences, but he said he has largely backed Obama’s agenda. Sanders said the president has been "even handed" in his treatment of the candidates vying to replace him, and he showed no interest in trying to strike any sharp contrast with his host.

"We have got to do a lot better to protect the middle class and working families," Sanders said. "But it’s also important to remember how far we’ve come in the last seven years under the leadership of President Obama and Vice President Biden."

The White House said the president considered the 45-minute meeting a chance to discuss ways the two could work together, to reminisce about the thrill of campaigning in Iowa and to talk broadly about the state of the 2016 race.

The president believes Sanders’ bid is good for Democrats, White House spokesman Josh Earnest said.

"That ability to engage Democrats and excite them and inspire them will be critical to the success of Democrats up and down the ballot, whether Senator Sanders is the nominee or not," Earnest said.

The long-discussed meeting between Obama and his sometime critic was a moment for the president to display public neutrality in the heated and unexpectedly tight primary race to replace him — refuting suggestions that he’s in the can for Sanders’ rival Hillary Clinton. For Sanders, it was a chance to show he’s got some sway with a president still popular among Democrats.

But the White House isn’t suggesting Obama and Sanders are kindred spirits, or even close political allies. White House officials says the men lack much of a personal relationship and have markedly different approaches to politics. The president this week declared bluntly he doesn’t see Sanders’ upstart campaign as a reboot of his own battle against Clinton in 2008. Obama allies bristle at comparisons between Sanders and the president.

Their reaction is reminder that even as Obama watches the nomination battle from a distance in Washington, he is personally tied to the outcome. Obama remains focused on ensuring a Democrat wins the White House and on protecting his legacy.  Increasingly, it appears, he sees Clinton as his best hope.

With the Iowa caucuses just days away, Obama recently showered praise on Clinton and threw some cold water on the Sanders. The president cast Clinton as ready to go on Day One, and Sanders as a compelling political star, but also a "bright, shiny object" in need of some more scrutiny.

Sanders said Wednesday he didn’t see the interview as a dig. He said he believed the president and the vice president have been "fair and even handed."

"And I expect they will continue to be that way," he said.

Sanders said with a laugh that he didn’t directly ask for Obama’s endorsement. He did ask for an update on the fight against Islamic extremism and the effort to warm relations with Iran, he said.

Despite his criticism of Obama on health care, Wall Street regulation and other economic issues, Sanders said that on the "major issues I have stood by his side" against Republican opposition.

White House officials say Obama’s comments were a as much a reflection of Obama’s high regard for Clinton, as any discomfort with Sanders. They reflected the reality of the relationship between the two men — there isn’t much there.

Sanders’ visit to the Oval Office will be his first extended meeting with the president since becoming a leading contender.

The White House says Sanders and Obama first discussed the meeting at a White House holiday party in late December and aides have been working on scheduling it since.

The session will be private meeting, no photos or statements or formal agenda.

The visit was one of several trips to the Obama White House for Sanders, typically for large, social events or policy rollouts. But the senator hasn’t been a close ally or regular staple in strategy meetings.

That’s a sharp contrast to Obama’s relationship with Clinton — which has been both deep and complicated. As his Secretary of State Obama has worked closely with Clinton, spent hours on Air Force One, shared personal moments and some policy clashes. Even since leaving her post, Obama has met privately with Clinton periodically, often for lunches at the White House.

On Wednesday, Obama met with Sanders before eating lunch with Vice President Joe Biden.

(Copyright (c) 2016 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox