Democratic presidential candidate Hillary Clinton spoke at her Brooklyn headquarters where she thanked supporters and said that rival Donald Trump is "trying to wall off Americans from each other." (Victoria Walker/The Washington Post)

Hillary Clinton celebrated her status as the first woman to win a major party’s presidential nomination on Tuesday evening in Brooklyn – and then turned quickly from history to politics, attacking GOP rival Donald Trump as a bully who wanted to “take America backwards.”

“To be great, we can’t be small,” Clinton told a cheering crowd in Brooklyn, previewing a general-election campaign in which she will attack Trump as vulgar, erratic and divisive. Clinton cast the election as a test of national identity: “This election is different. It really is about who we are as a nation…We are better than this. We won’t let this happen in America. And if you agree, whether you’re a Democrat, Republican or independent, I hope you will join us.”

Clinton’s speech came on a night when she won primaries in New Jersey and New Mexico, and lost the caucuses in North Dakota to rival Sen. Bernie Sanders (Vt.). Races in two other states – South Dakota and Montana – remain too close to call, with Clinton narrowly in the lead in both. Polls in California, the biggest prize of the night, closed at 11 p.m. Eastern time.

Clinton’s speech had been robbed of some of its drama, after the Associated Press declared Monday night that she had gathered enough delegates to win the nomination. But Clinton sought to re-create it, entering to a song with the refrain “I want to see you be brave,” and citing the work of early suffragettes in fighting for women’s right to vote. She noted that the room she was speaking in was a giant greenhouse.

“It may be hard to see tonight, but we are all standing under a glass ceiling right now. But don’t worry, we’re not smashing this one,” Clinton said, in a reference to her concession speech from the 2008 election, when she said that the “glass ceiling” had about 18 million cracks in it, a reference to the votes she’d received in a losing primary campaign against then-Sen. Barack Obama (Ill.). “Thanks to you, we’ve reached a milestone. The first time in our nation’s history that a woman will be a major party’s nominee.”

Clinton also used the speech to reach out to Sanders, who had threatened to push their primary contest all the way to the party’s convention in Philadelphia.

“Now I know it never feels good to put your heart into a cause or a candidate, that you believe in, and to come up short. I know that feeling well,” Clinton said. “But as we look ahead, to the battle that awaits, let’s remember all that unites us.”

She then recited a series of attacks on Trump, hoping that Sanders supporters – and Sanders himself – might see the Republican as an enemy they held in common with Clinton.

Sanders himself has not indicated what he will do after Tuesday. He is reportedly going to speak late at night, after the results from California begin to come in.

Sanders, a self-described “Democratic socialist” from Vermont, rocketed out of obscurity with an urgent call to fight income inequality and big money in politics. He gave Clinton an unexpectedly close race, but now trails her in votes, “pledged” delegates and un-pledged superdelegates. And, after Tuesday night, there will be no more states to fight over. Only the D.C. primary remains.

Sanders’s showing in Tuesday’s races — especially in California, where the race could be close — may determine whether he tries to fight on to the party convention, seeking to “flip” super-delegates committed to Clinton.

502 Bad Gateway

In a news conference at one of his golf clubs on Tuesday night, Trump attacked Clinton for her use of a private email server, and called her a symbol of a “corrupt system.”

“There’s one thing we all have learn. We can’t fix the rigged system by relying on very – and I mean this so, so strongly – on the very people who rigged it. And they rigged it. We can’t solve our problems by relying on the politicians who created our problems,” Trump said. He promised a speech next week that would delve into the problems of the Clintons.

Trump – reading, uncharacteristically, from a prepared text – made a pitch for voters supporting Sanders. “To all of those Bernie Sanders voters, who have been left out in the cold…we welcome you with open arms,” he said.

At the same time, Trump seemed to speak to his fellow Republicans, trying to reassure them after an awful week in which the presumptive GOP nominee attacked a federal judge, saying he was biased against Trump in an ongoing fraud cause because the judge is “Mexican.” The judge is American, born in Indiana to parents who were Mexican immigrants. It seemed to be a simultaneous rejection by Trump of both the American melting pot, and public trust in the judicial branch.

Trump did not mention the case, or the judge. But he told Republicans, “I will never, ever let you down.”

As a sign of the Democratic Party’s effort to close ranks around Clinton, House Minority Leader Nancy Pelosi announced her support Tuesday just before polls opened in her home state, California.

Speaking in an interview with George Stephanopolous on ABC’s “Good Morning America,” Pelosi emphasized the need for her party to coalesce soon for the general election.

“Bernie knows better than anyone what’s on the line in the election and that we at some point have to unify as we go forward,” he said. “He wants to influence the platform. I think that’s fine.”

Sen. Jeff Merkley (D-Ore.), the one sitting senator who has endorsed Sanders, said in an interview Tuesday that it is important to allow the remaining six states and the District of Columbia to vote before declaring a presumptive Democratic nominee. But he added that just as Obama and Clinton saw “the lay of the land” in 2008 after all the primary voters cast their ballots, “we’ll soon be able to see the parts of the party work together to unite.”

“I think we’ll be absolutely united in making sure the self-promoting huckster named Donald Trump never becomes president of the United States,” he said, adding that Clinton should learn from Sanders’s connection with voters. “If Secretary Clinton is the nominee, she will not win in November without a deep and profound and passionate understanding of the issues that have so moved the grass roots in America.”

Clinton’s pivot to the race against Trump unofficially began last week with a withering speech on foreign policy in which she shredded the real estate mogul’s qualifications and temperament. Those attacks have continued this past weekend at appearances up and down California and have been received with unprecedented enthusiasm by her supporters.

“Donald Trump is not qualified to be president of the United States of America, but we can’t just say that assume everybody understands it,” she said at a star-studded “She’s With Us” concert at the Los Angeles Greek Theatre on Monday night. “We have to make the case and organize and mobilize.”

Clinton has faced an unexpectedly strong and increasingly contentious challenge from Sanders, and there is the possibility that the senator will keep battling her even now that she has effectively sewn up the nomination. Sanders has said it made no sense to declare the race over until the votes of the superdelegates are counted next month at the convention.

After finishing breakfast with his family in San Francisco, the senator sounded upbeat about the remaining primaries.

“I think we’ve got a shot,” he said outside The Butler & The Chef bistro as he greeted a throng of cheering supporters. “I’m feeling great.”

Before the polls opened Tuesday, Sanders’s campaign manager sent an email to supporters acknowledging that the reported delegate count for Clinton could suppress voter turnout. But the message asked for help in phoning California voters so that Sanders could “defy the pundits once more” and “shock the establishment.”

“We know that this race is going to carry on until the delegates cast ballots at the convention in Philadelphia,” said campaign manager Jeff Weaver. “We should let the voters decide who they want the Democratic nominee to be rather than having the media decide for them. I am asking you to continue to stand with Bernie in pushing for the political revolution.”

Sanders met with some voters in the Bay Area later Tuesday morning and then flew to the Los Angeles area, where he was to tape an interview with Lester Holt of “NBC Nightly News” in Burbank and then hold an election night rally in Santa Monica.

Outside the coffee shop where Sanders ate, voters appeared split about what path Sanders should pursue. Kyle Sorrels, a 25-year-old engineer and self-described progressive, described Clinton “as unacceptable as Donald Trump to be the president” and said that he had informed his employer he would move to Berlin if either candidate won in November.

“My hope is that Hillary gets indicted in the next few weeks and Bernie gets it,” he said. As he walked away he said to no one in particular, “Feel the Bern! Hillary for prison!”

Bobby Schultz, 38, an independent voter and a software developer from San Bruno, Calif., who was sipping coffee with friends nearby, said he was “surprised” Sanders was still running.

“I really like Bernie, but as this point the race is pretty much over,” he said.

Tuesday marks the exact anniversary of the day eight years ago when Clinton conceded the Democratic nomination to then-Sen. Obama. The president could endorse Clinton as soon as this week, not waiting for the Democratic convention in July, according to White House press secretary Josh Earnest.

Speaking to reporters Tuesday, Earnest said that out of respect for the ongoing voting, “I’m not going to declare a winner from here.” But he emphasized that Obama intends “to make his voice heard in coming together” behind the presumptive nominee and planned to play a role in brokering a rapprochment between the two candidates.

He added that Obama’s endorsement could influence Republicans, not just Democrats, given his seven and-a-half years in the job. “The president is an important validator.”

An Obama endorsement would be a significant boost to Clinton as she seeks to unify Democrats after the difficult primaries. It would send a strong message to Sanders and his supporters that they should coalesce around Clinton, something Sanders has indicated he is far from ready to do.

“Obviously, I’m excited about having the president’s support, because I have said throughout this campaign I was honored to serve in the president’s Cabinet,” Clinton said.

Phillip reported from Los Angeles. Juliet Eilperin and John Wagner in Washington and Robert Costa in San Francisco contributed to this report.