WASHINGTON (AP) — Testifying to Hillary Clinton’s grit and experience, President Barack Obama endorsed his former secretary of state’s bid to succeed him on Thursday and urged Democrats to line up behind her. It was all part of a carefully orchestrated pressure campaign aimed at easing Clinton rival Bernie Sanders toward the exit and turning fully to the fight against Republican Donald Trump.

Obama’s long-expected endorsement, delivered via web video , included a forceful call for unity and for ‘‘embracing’’ Sanders’ economic message, which has fired up much of the liberal wing of his party. Obama sought to reassure Democrats that Clinton shares their values and is ready for the job.


‘‘Look, I know how hard this job can be. That’s why I know Hillary will be so good at it,’’ Obama said. ‘‘I have seen her judgment. I have seen her toughness. I’ve seen her commitment to our values.’’

Obama’s testimonial came less than an hour after the president met privately with Sanders at the White House to discuss the future of Sanders so-called political revolution — one that will not include him taking up residence at the White House. Sanders emerged from the meeting subdued and indicated he had gotten the message.

Although he stopped short of endorsing Clinton, the Vermont senator told reporters he planned to press for his ‘‘issues’’ — rather than victory — at the party’s July convention and would work with Clinton to defeat Trump.

‘‘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,’’ Sanders said, standing in the White House driveway with his wife, Jane, at his side.

Clinton declared victory over Sanders on Tuesday, having captured the number of delegates needed to become the first female nominee from a major party. Her late and somewhat sputtering victory set off a blitz of private phone calls and back-channel negotiations, all aimed at sussing out Sanders’ demands, easing him out of the race and putting the full-court press on Trump.


Obama’s endorsement and Sanders’ visit were the public culmination of that work.

The wording of Sanders’ statement to reporters was prepared in advance of his meeting with Obama. The White House acknowledged it had taped Obama’s endorsement video on Tuesday, before Clinton claimed victory in the primary.

The careful choreography was part of the Democrats’ attempt to show some respect to Sanders, even as they steered the long-time senator toward the campaign off-ramp.

Obama greeted Sanders and his wife in the residence and then strolled with the senator, smiling and laughing warmly, past the Rose Garden to the Oval Office, where he opened the door for the senator as cameras recorded the moment.

The ceremony and scrutiny didn’t appear to faze Sanders. Ever the everyman, he started the day by stopping for a cup of coffee and a scone at the Peet’s coffee shop across from the White House, while dozens of reporters awaited his arrival.

Sanders’ campaign had little to say about his conversation with the president, saying the men discussed ‘‘how we can all work together to create an economy that works for all people and not just the 1 percent.’’

Sander had vowed to keep up his campaign. But on Thursday, he highlighted a different goal. Sanders said he would compete in the Washington, D.C., primary on Tuesday, the party’s final contest, but said his interest was largely in pushing for D.C. statehood.

Leaders on Capitol Hill underscored Obama’s message. After leaving the White House, Sanders met with Senate Minority Leader Harry Reid, D-Nev., and Sen. Charles Schumer, D-N.Y. The Vermont senator planned to meet with Vice President Joe Biden, too.


As he walked through the halls he knows so well, Sanders ignored a reporter’s question about the president’s endorsement of Clinton.

Even some of Sanders’ staunchest supporters have started looking to Clinton. Sen. Jeff Merkley of Oregon, the one Senate Democrat to endorse Sanders, said Clinton was the nominee and offered his congratulations. And Rep. Raul Grijalva, a Sanders backer from Arizona, suggested the time to rally behind Clinton would come after the D.C. primary.

‘‘Bernie’s going to do the right thing,’’ Grijalva said.

The situation has put Obama, the out-going 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 to help her defeat Trump.

Obama has been trying to give Sanders the courtesy of exiting the race on his own terms. Much of his endorsement video was spent thanking Sanders for his work energizing the party.

Now head-to-head in the presidential race, Clinton and Trump have one thing in common: Both are working to woo Sanders supporters. Trump has said he welcomes Sanders’ voters ‘‘with open arms’’ while Clinton has vowed to reach out to voters who backed her opponent in the Democratic primary.

The two took to Trump’s preferred medium to tangle Thursday. Trump responded to Obama’s endorsement by tweeting: ‘‘Obama just endorsed Crooked Hillary. He wants four more years of Obama_but nobody else does!’’

The Clinton campaign tweeted back: ‘‘Delete Your Account.’’

___

Associated Press writers Ken Thomas, Erica Werner, Laurie Kellman and Lisa Lerer contributed to this report.

___

Reach Josh Lederman on Twitter at http://twitter.com/joshledermanAP and Kathleen Hennessey at https://twitter.com/khennessey