Bernie Sanders
Democratic U.S. presidential candidate Bernie Sanders delivers a statement beside his wife, Jane O’Meara Sanders, after departing the West Wing of the White House in Washington following a meeting with President Barack Obama June 9, 2016. Reuters/Gary Cameron

Democratic presidential candidate Bernie Sanders said on Thursday he would work with rival Hillary Clinton to defeat Republican Donald Trump, though he promised to stay in the White House race through the last primary election next week.

Sanders, a U.S. senator from Vermont, spoke outside the White House after a meeting with President Barack Obama, as Democrats pressured him to end his campaign and support Clinton after a hard-fought primary race.

Clinton, the former secretary of state, won enough delegates to secure the Democratic nomination this week and become the first woman to lead a major U.S. party as its presidential nominee.

Sanders said he had congratulated Clinton and looked forward to meeting with her in the future. He also thanked Obama for remaining impartial during the Democratic primary process.

He said on Thursday he would compete in the final primary, in Washington, D.C., on June 14. His campaign has previously said he would carry his populist campaign to the Democratic National Convention in Philadelphia in late July, when the party's nominee is formally chosen.

Obama, who was expected to endorse Clinton soon, welcomed Sanders to the White House, chatting and chuckling as they walked into the Oval Office. Sanders will meet with Senate Minority Leader Harry Reid, a Democrat, in the afternoon.

Obama said on Wednesday he hoped divisions between Democrats would start to heal in coming weeks now that Clinton has clinched the party’s nomination for the Nov. 8 presidential election.

“It was a healthy thing for the Democratic Party to have a contested primary,” Obama said at a fund-raiser in New York City later on Wednesday.