Hillary Clinton cast herself as America's strongest leader in a scary world during the second Democratic presidential debate.
But at the event in Des Moines, Iowa, she found herself forced to defend her own role during the rise of the Islamic State (IS) militants.
"This election is not only about electing a president, it's also about choosing our next commander in chief," Mrs Clinton said.
"All of the other issues we want to deal with depend upon us being secure and strong."
Amid the backdrop of global anxiety over Friday's attacks in Paris, Mrs Clinton found herself fending off questions about not only her foreign policy record but her economic ties.
Both Vermont senator Bernie Sanders and former Maryland governor Martin O'Malley painted the former senator from New York as a lackey for Wall Street and corporate interests.
"Let's not be naive about it," said Mr Sanders, noting that Mrs Clinton collected millions in campaign donations from Wall Street bankers.
"They expect to get something. Everybody knows that."
The barbs marked a far more aggressive shift in a primary race that has so far been notable for its civility.
Democrats have spent months boasting about the substantive tone of their contest, attempting to set up a favourable early contrast with the "carnival barker" insults of the crowded Republican race.
Since the Democrats' first debate a month ago, Mrs Clinton has built a lead in the early voting states.
The gains have come amid other signs the party is coalescing behind her, but the nomination fight is far from over.
In Des Moines, Mrs Clinton faced criticism of her national security record.
Mr Sanders traced the current instability in the Middle East to the US Senate's vote - including Mrs Clinton's - to authorise military action in Iraq in 2002.
He said that US invasion "unravelled the region".
The former secretary of state fought back, saying terrorism has been erupting for decades, specifically mentioning the September 11, 2001, attacks.
S he said the recent unrest in Libya and other parts of the Middle East is symptomatic of an "arc of instability from North Africa to Afghanistan".
Mrs Clinton rejected the idea that she and the rest of the Obama administration underestimated the growing threat of IS.
The row revealed a foreign policy split within the Democratic Party, with Mr Sanders playing to the anti-war activists who boosted then-Illinois senator Barack Obama to victory in 2008.
Mr Sanders argued for a far more hands-off approach, advocating for Muslim countries to lead the fight and declaring that the war against IS militants is about the "soul of Islam".
Mrs C linton has a history of advocating for more robust involvement across the globe - both as a presidential candidate eight years ago and as Mr Obama's secretary of state.
In recent weeks, she has called for a more aggressive US role in the Syrian conflict, including a no-fly zone over the area, a move the Obama administration opposes.
But she stood by her opposition to seeking a formal declaration of war against IS.
All the candidates denounced the Paris attacks, and the debate began on a solemn note with a moment of silence followed by the previously unplanned foreign policy questions.
The conversation later pivoted to economic issues, with the candidates sparring over how to pay for their plans to expand college affordability, family leave and prescription drug coverage.
The conversation revealed how Mr Sanders' message has helped shift the party to the left on some economic issues.
All three agreed that wealthy citizens and corporations should pay more in taxes to benefit the middle class.
They argued over how high to increase the minimum wage, with Mrs Clinton backing a 12 dollar (£7.90) an hour floor.
Mr Sanders and Mr O'Malley both said 15 dollars (£9.85) an hour - the rate being pushed by a campaign of fast-food workers and unions.
The also fought over the degree to which they would curtail large financial institutions, with Mr Sanders describing Wall Street's business model as "greed and fraud" - a startling judgment for a major presidential candidate.
"I'm not that much of a socialist compared to Eisenhower," joked Mr Sanders, saying the former president backed a 90% marginal tax rate.