WASHINGTON — In a scrappy, argumentative debate between the major-party vice presidential candidates, Republican Mike Pence attacked Hillary Clinton through her running mate, Democrat Tim Kaine, blaming the former secretary of state for paving the way for the rise of the Islamic State group with the US withdrawal from Iraq.

The two hammered each other's running mate over national security, while Kaine cast Donald Trump as full of dangerous, half-baked ideas, and Pence cast Clinton as the architect of President Barack Obama's foreign policy, which he called weak and feckless. In style, an eager Kaine ran hot, frequently talking over his Republican rival, while Pence struck a cool, polished tone.

"Our primary threat today is ISIS," Pence said. "And because Hillary Clinton failed to renegotiate a status of forces agreement that would have allowed some American combat troops to remain in Iraq and secure the hard-fought gains the American soldier had won by 2009, ISIS was able to be literally conjured up out of the desert, and it's overrun vast areas that the American soldier had won in Operation Iraqi Freedom."

In a defense of Clinton's trustworthiness, Kaine said of Trump early in the debate: "[My wife and I] have a son deployed overseas in the Marine Corps right now. We trust Hillary Clinton as president and commander in chief, but the thought of Donald Trump as commander in chief scares us to death."

The debate pit Pence, Indiana's governor, against Kaine, the former governor of Virginia and its junior senator. Both have a son serving in the US Marine Corps, both have Catholic backgrounds — though Pence is now evangelical — and both are longtime politicians.

While in Congress, Pence served in the conservative Tea Party Caucus and as chairman of the House Foreign Affairs subcommittee on the Middle East, where he backed the 2007 surge in Iraq and defended the original decision to invade. Ahead of the debate, the pressure was on Pence to reverse the momentum of the Trump campaign after his running mate stumbled in the debate against Clinton last week, and on the trail, with widely condemned comments about veterans with post-traumatic stress disorder.

Kaine serves on the Senate Armed Services and Senate Foreign Relations committees, and has both railed against the Obama administration's use of the 15-year-old authorization of the use of military force to fight in Iraq and Syria and called on Congress to pass a new one. In the debate, he sought to credit Clinton as a member of the team that killed Osama bin Laden and landed the controversial nuclear deal with Iran, and at one point called Trump a "fool" for nuclear weapons proliferation remarks.

"Trump can't start a Twitter war with Miss Universe without shooting himself in the foot," Kaine said, alluding to a Trump gaffe from earlier in the week.

On ISIS, Kaine outlined Clinton's plan to target its leaders, its financing, its online recruitment and "surge" intelligence with allies. Trump, on the other hand, was full of "dangerous ideas," he said: that NATO is obsolete, that US generals "need to be fired," that Trump "loves dictators" and that the world would be safer if more countries had nuclear weapons.

While Pence said Kaine's attack had "a lot of creative lines," he counter-attacked Clinton and Obama as having "weakened America's place in the world" through "a lack of leadership."

On Russia, Pence struck a more strident tone than his running mate. The US would be better suited to confront Russia with a stronger military, he said, and reiterated Trump's promises to rebuild it. Meanwhile, the US could establish safe zones in Syria, meet Russia's provocations "with American strength," and deploy a missile defense shield to the Czech Republic and Poland.

"If Russia chooses to be involved and continue, I should say, to be involved in this barbaric attack on civilians in Aleppo, the United States of America should be prepared to use military force to strike military targets of the Assad regime to prevent them from this humanitarian crisis that is taking place in Aleppo," Pence said.

Kaine — who said he and Clinton agree on humanitarian safe zones — challenged Pence to defend Trump's professed admiration for Russian President Vladimir Putin as a better leader than Obama. He argued Trump's refusal to share his tax records meant the GOP presidential hopeful could be covering up business ties that would compromise his national security choices.

"Hillary also has the ability to stand up to Russia in a way that this ticket does not," Kaine said, adding later: "If you don't know the difference between dictatorship and leadership, then you got to go back to a fifth-grade civics class."

Twitter: @ReporterJoe

Joe Gould is the Congress reporter for Defense News.