GOP presidential candidates clashed over immigration, government spending and how to handle Russia's Vladimir Putin during Tuesday night's debate. As the night got heated, the audience got involved: Here are the must-watch moments. (Ashleigh Joplin and Rebecca Schatz/Fox Business Network)

Republican presidential contenders have long viewed foreign policy as a key area of strength in a potential general-election matchup against Democratic front-runner Hillary Rodham Clinton.

But first, the party must resolve its own identity crisis on the subject, which erupted into view in the fourth Republican debate Tuesday night and flowed quickly onto the campaign trail the next day.

Many in the GOP had been relishing the opportunity to vigorously prosecute the former secretary of state’s role in what they have disparagingly dubbed the “Obama-Clinton foreign policy legacy.”

The large GOP field’s muddled positions have shown that it won’t be easy.

What they said on the issues

Unlike abortion and same-sex marriage, on which the Repub­lican candidates mostly agree, there are deep divisions on ­foreign policy and national security, highlighting how President Obama’s agenda abroad, and by extension Clinton’s, have become difficult to assail from a consistent posture.

There is also inconsistent command of the subject matter — a sharp contrast with the sure-footed knowledge that Clinton has displayed, most recently at a grueling, 11-hour congressional hearing last month on the 2012 terrorist attacks in Benghazi, ­Libya.

In one camp on the Republican side are staunch hawks, including Sen. Marco Rubio and former governor Jeb Bush, both from Florida. In another stand more non-interventionist candidates, Sen. Rand Paul (Ky.) and businessman Donald Trump. While all are united against the policies of Obama and Clinton, their counter­arguments are tangled.

“There’s no question that among the candidates on the [debate] stage, the party is all over the map,” said Ford O’Connell, who worked on the presidential campaign of Sen. John McCain (R-Ariz.) in 2008 and is neutral in the 2016 race. He added that he expects the hawks, eventually, to prevail.

Bush, campaigning in Iowa on Wednesday, tried to do his part to make that happen, arguing for stronger leadership in the Middle East, a region where he said there is “dramatic instability.” “The United States needs to lead in this regard,” he said.

In Tuesday’s debate, Bush clashed with Trump over Middle East policy. Trump said he is happy to see Russia disable the Islamic State terrorist group with a bombing campaign in Syria. Bush interrupted to note that Russia’s bombing campaign has largely targeted not the Islamic State but U.S.-backed forces opposed to Syrian President Bashar al-Assad.

Bush also warned against outsourcing leadership in the region to Russian President Vladimir Putin, whose relationship with the United States has become tense in recent years.

Carly Fiorina speaks as Rand Paul listens during the fourth GOP debate on Tuesday. (Morry Gash/AP)

Bush and Trump were part of an eclectic cast of eight White House hopefuls who stood on the debate stage in Milwaukee on Tuesday in discord over Russia, Syria, Islamist terrorism and military spending.

The relationship between Putin and the United States was one focus of the evening — and it should have been an opportunity to tarnish Clinton, who continues to be haunted by the symbolic reset button she presented to her Russian counterpart in an effort to change course from the testy relations that had characterized the George W. Bush years.

But the Republican debaters were bogged down in their own skirmishes. When a moderator asked a question after noting that Obama had once mocked Mitt Romney for being an alarmist about Russia, only to see Moscow later escalate its aggression against nearby countries, the field missed a plum chance to critique the Democratic decisions with a uniform rebuttal.

Instead, Trump responded by bragging that he got to know Putin “very well” during an appearance on a TV newsmagazine. Bush jumped in to criticize Trump, comparing his strategy in Syria to “playing Monopoly.” Former Hewlett-Packard chief executive Carly Fiorina noted that she, too, had met Putin and is not inclined to talk to him.

Discordant views were not the only worry for Republicans that emerged from the debate’s focus on foreign policy. During some of the back-and-forth, several candidates appeared confused as to what the issues were and what was happening on the ground. Several misstated the facts and confused geography, perhaps in their eagerness to appear tough while charging that their Republican opponents, and Obama, were weak.

Ben Carson, the retired neurosurgeon who has risen to the top of the polls, appeared to suggest, inaccurately, that the Chinese government has a military presence in Syria. His campaign defended his remark Wednesday, offering media reports, some several years old, of Chinese warships sailing near Syria.

Carson also said that “several generals” had told him it would be “fairly easy” and decisive for the United States to “take . . . a big energy field” away from the Islamic State. He said it was just outside Iraq’s Anbar province. It was unclear what he was talking about, since there are no major oil fields inside or near Anbar, which makes up about one-third of Iraq but is in the southwest, far from the country’s oil reserves in the northern Kurdish region and in the southeast.

Trump, apparently referring to the 2003 U.S. invasion and occupation of Iraq, said that “we should have kept the oil . . . we should have given the oil . . . to the people who lost their arms, their legs and their families.”

“Because you know who has a lot of that oil? Iran, and ISIS,” he said. Trump appeared to be suggesting that the United States, after “liberating” Iraq, should have maintained control of its oil, which is now under the control of neither Iran nor the Islamic State.

On Russia, Bush said that it was “tragic” that the Iraqi government had held talks with Russia and that “it wasn’t that long ago that Russia had no influence in the region at all.” But Russia has been Syria’s prime arms supplier and a major ally since the 1970s and has long maintained a naval installation on Syria’s Mediterranean coast.

When Fiorina said that Ronald Reagan was strong enough to walk away from Russian intransigence during the 1986 summit in Reykjavik, Iceland, Paul interjected that “Ronald Reagan was strong, but Ronald Reagan didn’t send troops into the Middle East.” That comment overlooked Reagan’s two Marine deployments to Lebanon during the early 1980s. During the second deployment, of 1,200 Marines, 241 were killed when a suicide bomber destroyed their barracks in Beirut. In response, Reagan withdrew the rest of the Marines.

The divergent views in the Republican field are not likely to fade soon — even though polling shows that the GOP has become more hawkish in recent years.

Paul’s appeal has slipped amid that shift in opinion, and it may also pose risks for other contenders.

Rubio, who called Putin a “gangster” during the debate, seemed to sense the opportunity when he fired off a fundraising e-mail Wednesday morning attempting to distinguish his aggressive national security posture from his rivals’.

“American strength will deter aggressors, meaning fewer wars, not more,” he wrote. “Sadly, even some Republicans suggest that we can’t afford to keep our military strongest in the world. The reality is, we can’t afford not to.”

It seemed like a direct shot at Paul, who had argued in the debate against being overly hostile to the Russians.

Another contender, Sen. Ted Cruz of Texas, has tried to position himself in the “middle ground” between Paul and Rubio.

Bush expressed confidence that the divide within the GOP won’t imperil the eventual nominee’s ability to pounce on Clinton’s foreign policy résumé in the general election.

“I think the failure of the Obama-Clinton foreign policy is so apparent, the chaos that has erupted by the voids we’ve created is so clear for Americans,” he said on the campaign trail Wednesday.

Then he explained what he thinks the public wants the next president to do. “It’s not that they want to have, as I said last night, the United States be the world’s policeman, but they do sense that we’ve lost our way in terms of our leadership,” Bush said.

But the question of what, exactly, that leadership role should look like is far from settled in today’s Republican Party.

Ed O’Keefe in Atlantic, Iowa; Jenna Portnoy in Lynchburg, Va.; and Scott Clement and Jose A. DelReal in Washington contributed to this report.