Donald Trump and terrorism were the main talking points during the latest "undercard" Republican presidential primary debate on Tuesday.

Based on lower polling numbers, CNN's "undercard" debate featuring Sen. Lindsey Graham of South Carolina, former New York Gov. George Pataki, former Arkansas Gov. Mike Huckabee and former Pennsylvania Sen. Rick Santorum.

Graham focused on his foreign policy experience, noting he just returned from his 36th trip to Iraq and Afghanistan within the last decade. Pataki criticized Democratic presidential candidate Hillary Clinton's record on combatting terrorism, while dismissing Trump's political rhetoric.

"Neither is fit to be president of the United States," said Pataki, referring to Clinton and Trump.

According to Santorum, the U.S. has entered World War III.

Graham criticized Trump's proposal to temporary ban Muslim immigration into the U.S.

"You may think this makes us safe, but it doesn't," said Graham. "Donald Trump has done the one single thing you cannot do, declare war on Islam. ... ISIL would be dancing in the streets, they just don't believe in dancing."

But despite criticizing Trump, Graham said he would support Trump if the latter becomes the Republican nominee.

"I know people will pile on because it makes sense to pile on ... but he brings up a legitimate issue," Santorum later said about Trump's proposal, adding that not all Muslims are jihadists but "all jihadists are Muslims."

Graham also hit at Sens. Rand Paul of Kentucky and Ted Cruz of Texas for being "isolationists," for not allowing the National Security Agency (NSA) to monitor international calls into the U.S. For Graham, being an isolationist is "no better than Obama."

Speaking about Islam, Santorum said it is not solely a religion but also a "political governing structure."

Huckabee said he would allow law enforcement to monitor mosques for activity.

In regards to Syria, Graham reiterated his support for ground troops. He said anyone who opposes American boots on the ground in Syria is "not fit to be commander in chief." While Graham's stance is to remove Syrian President Bashar al-Assad from power, Huckabee said he doesn't have an immediate preference on handling Assad since the Syrian leader hasn't killed Americans.

Graham blamed President Barack Obama for the rise of the Islamic State militant group and not former President George W. Bush.

"I miss George W. Bush. I wish he was president right now. We wouldn't be in this mess," said Graham.

When asked whether women should be allowed to serve in the front lines of the military, Santorum said he opposes the concept and blamed the military for ignoring jobs that raised questions about women in certain jobs.

Santorum said, "I would change the policy to reflect what is the best interest of the people."

Pataki disagreed with Santorum, saying if women want to serve, then they have the right.

On immigration, Huckabee said he will not continue any of Obama's deferred action programs. He said it is the responsibility of Congress to deal with immigration reform, and not one individual, acting as a "king" to act policy. Santorum said the U.S. "created a magnet" and is attracting people, including Syrians, because the country has a policy of amnesty.

Following closing remarks, the debate ended at 8:12 p.m. EST.