But Sanders, speaking to reporters at the White House, stopped short of endorsing Hillary Clinton, the presumptive Democratic nominee. The president was expected to endorse her later in the day.
Sanders said he hoped to meet with Clinton soon to discuss their common goal.
"Needless to say, I am going to do everything in my power and I will work as hard as I can to make sure that Donald Trump does not become president of the United States," he said.
Sanders' remarks came after a longer-than-expected Oval Office sit-down with Obama, part of Democratic leaders intensifying effort to unite behind Clinton as the nominee of the party.
More From This Section
Clinton declared victory over Sanders on Tuesday, having captured the number of delegates needed to become the first female nominee from a major party.
Still looking like a candidate, Sanders planned a rally today evening in Washington, which holds the final primary contest next week.
The situation has put Obama, the outgoing leader of his party, in the sensitive position of having to broker detente between Clinton and Sanders without alienating the runner-up's supporters, many of whom are angry over what they see as the Democratic establishment's efforts to strong-arm him out of the race. Clinton is counting on Sanders' supporters backing her to defeat Trump.
"It was a healthy thing for the Democratic Party to have a contested primary. I thought that Bernie Sanders brought enormous energy and new ideas," Obama said yesterday during a taped appearance on "The Tonight Show Starring Jimmy Fallon.