SAN DIEGO — Hillary Clinton presented a stark contrast Thursday between what she said are her own extensive qualifications to command American foreign policy and Donald Trump’s reckless ignorance about national security.

In an afternoon speech here in which she described Trump’s ideas as “dangerously incoherent,” Clinton offered a sharply worded preview of a general election argument that will frame her as a well-prepared commander in chief and Trump as unfit. In her strongest terms yet, she made clear that her pivot to the fall contest is underway, even with a series of final primary contests against Sen. Bernie Sanders still ahead.

Trump “doesn’t understand America, or the world,” she said. “They’re not really ideas, just a series of bizarre rants, personal feuds and outright lies.”

Clinton called him “temperamentally unfit” to lead the country, too cavalier about the history of American leadership and responsibility abroad and too admiring of dictators.

“It’s not hard to imagine Donald Trump leading us into a war just because somebody got under his very thin skin,” she said.

She listed Trump statements on everything from the NATO alliance to threats from Russia and North Korea – and played Trump’s assertions about climate change for laughs.

“If Donald gets his way, they’ll be celebrating in the Kremlin,” she said. “We cannot let that happen.”

A CHANCE TO DISPLAY FLUENCY

The speech offered Clinton a forum to display her easy command of the history and context of American foreign policy and her fluency with the main themes likely to matter to voters this year: terrorism, Russian ambitions, Chinese military expansion, Mideast turbulence.

But mostly Clinton presented a sort of courtroom closing argument for why Trump should not be the leader of the world’s largest military and caretaker of an arsenal of nuclear weapons. He is too reckless, ill-informed and egomaniacal to be entrusted with the biggest job in the world, Clinton suggested, and the rest of the world is justifiably nervous about what he might do, she said.

Clinton also openly mocked Trump’s Twitter habit.

“We all know the tools Donald Trump brings to the table: bragging, mocking, composing nasty tweets,” she said. “I’m willing to bet he’s writing a few right now.”

As she spoke, Trump fired off a series of tweets, clearly indicating that he was watching her remarks live.

“Bad performance by Crooked Hillary Clinton! Reading poorly from the telepromter! She doesn’t even look presidential!” he wrote.

SHE EMPHASIZES EXPERIENCE

Clinton’s main assertion, hammered again and again, was that she has the experience, expertise and practical temperament to be commander in chief, and Trump does not. It’s a preview of how she will use what backers think will be her best offensive weapon against Trump: His own tendency to say and do things that look unpresidential.

More than a dozen American flags hug or stood behind Clinton as she spoke before a small audience of invited guests at historic Balboa Park. Before the speech began, a recording of the iconic Sousa march “Stars and Stripes Forever” replaced the usual playlist of girl-power anthems such as Katy Perry’s “Roar” that usually precedes Clinton events.

Trump had sought to rebut Clinton before she even spoke, spending parts of the last two days criticizing Clinton for her temperament and legacy as secretary of state.

“She’s one of the worst secretaries of state in the history of our country,” Trump said on Wednesday night. at a campaign stop in Sacramento. “Now she wants to be our president? Look, I’ll be honest, she has no natural talent to be president.”

Her speech, Trump said, would be full of “such lies.”

Just ahead of the address Trump tweeted, “Crooked Hillary, who I would love to call Lyin’ Hillary, is getting ready to totally misrepresent my foreign policy positions.”

TRUMP CITES IRAQ, LIBYA EVENTS

Trump criticized Clinton’s support for both the Iraq war when she was a senator and military intervention in Libya when she was secretary of state, policies he had also supported. Her Mideast policies as secretary of state left the region worse off, Trump asserted. He said she was “sleeping” during the seige of U..S. compounds in Benghazi, Libya, that killed four Americans in Benghazi, Libya, in the closing months of her State Department tenure.

Iraq became a main reason for Clinton’s loss to then-Sen. Barack Obama in 2008. She struggled to defend her support for the American-led invasion at a time when the war was widely considered a quagmire.

Although it has faded as a central campaign issue eight years later, both Trump and Sanders have sought to use her vote as evidence of poor decision-making. Clinton tried to neutralize the issue ahead of this campaign by writing in her State Department memoir that her support had been a mistake she regrets.

The speech comes as Clinton is trying to deny Sanders an embarrassing but symbolic victory in California’s primary. Several polls, including two out Thursday, put Clinton just two points ahead of Sanders in the nation’s most diverse state. That’s within the margin of error, meaning she is tied here and forced to mount a barnstorm effort in the closing days before Tuesday’s vote.

Although she is widely expected to secure the Democratic nomination the same day when five other states also hold primaries, a loss in California would highlight a central weakness – lack of enthusiastic support from her party’s liberal base and young voters – and hobble Clinton as she enters the general election in earnest.

Her choice of California to make a speech that highlights her own past as a foreign policy hawk suggests that she is also trying to look past Sanders and focus national attention on what she has already said is a certain head-to-head matchup with Trump.

Clinton and her allies are stepping up the intensity and tempo of attacks on Trump, on both foreign and domestic issues.

On New Jersey on Wednesday, Clinton hammered Trump over the legal controversy surrounding his now-defunct Trump University, labeling him a “fraud.”

“He is trying to scam America the way he scammed all those people at Trump U.,” she said.

A WEAPON OR A SHIELD?

Her tenure as secretary of state may be a weapon for Trump, but Clinton also believes it is her shield. As secretary of state, her approval rating hit an all time high of 66 percent, according to a long-running Gallup poll.

Her campaign trotted out a web video highlighting a range of endorsements from military and diplomatic figures of her tenure at State, including from President Obama.

Perhaps no Clinton ally’s foray into the 2016 presidential arena is more long awaited than Obama, who has increasingly tiptoed into presidential politics in recent days.

Speaking in Elkhart, Indiana, on Wednesday night at a town hall event hosted by PBS, the president excoriated Trump over foreign policy, echoing themes Clinton would expound on in San Diego on Thursday.

“He just says, ‘I’m gonna negotiate a better deal.’ Well how? How exactly are you going to negotiate that?” Obama said. “What magic wand do you have? And usually the answer is, he doesn’t have an answer.”

On Thursday, Obama appeared to have Trump in mind when he addressed graduates at the Air Force Academy.

“As we navigate this complex world, America cannot shirk the mantle of leadership,” Obama said. “We can’t be isolationists. It’s not possible in this globalized, interconnected world.”

Ari Fleischer, a spokesman and aide in the Republican White House of former president George W. Bush, said Clinton cannot rely on her popularity as secretary of state in the general election.

“Former secretaries of state are held in high regard; candidates are not – and she’s a candidate,” Fleischer said.

The general election, Fleischer argued, will pit Clinton’s temperament against Trump’s more unorthodox positions on foreign policy, especially his opposition to interventionism.

“Her strength is her temperament: She is so cautious, so scripted, that she won’t scare people in the knee jerk way that Donald Trump can scare people,” he said. “Trump, on the other hand, risks knee-jerk scaring people, but he’s against so many of the interventions that many of the American people themselves are against … it’s a real fair fight.”