"When candidates say we shouldn't admit three-year-old orphans, that’s political posturing," Obama said at the Asia-Pacific Economic Cooperation Summit in Manila — making a veiled reference to GOP candidate and New Jersey Governor Chris Christie. "When people say we should have a religious test, and only Christians, proven Christians, should be admitted, that's offensive, and contrary to American values."

He added, delivering another jab: “These are the same folks often times that say they're so tough that just talking to (Russian President Vladimir) Putin or staring down ISIL (ISIS) or using some additional rhetoric will solve the problem — and they’re scared of widows and three-year-old orphans."

Obama noted that refugees coming to the United States are screened for 18 to 24 months before being cleared to enter the country, with the intelligence agencies vetting applicants.

"We are not well served when, in response to a terrorist attack, we descend into fear and panic," Obama said, showing emotion — even anger. "We don't make good decisions if they're based on hysteria or an exaggeration of risks."

He reminded the foreign crowd of the Boston Marathon bombing and its aftermath: "We did not resort to fear and panic ... people went to ball game that same week, and sang the national anthem," Obama said.

"That’s how you defeat (ISIS) — not trying to divide the country or suggesting that our tradition of compassion should stop now."