WATCH: U.S. President Barack Obama has said Islamic State militants will be defeated by a combination of military, diplomatic, and other means. But, he added, U.S. troops would not get dragged into a ground war in Syria or Iraq. (AP)

U.S. President Barack Obama has said the recent shooting attack in California that left 14 people dead was "a terrorist attack" and that the two shooters "had gone down the dark path of radicalization."

Speaking in a primetime televised address from the White House -- only his third such speech in nearly seven years as president -- Obama said that the threat of terrorism has evolved into "a new phase" in recent years, but pledged that the Islamic State (IS) terrorist group will be destroyed.

The 13-minute speech comes days after a married couple attacked a social-services center in San Bernardino, California, killing 14 and wounding 21.

"I know that after so much war, many Americans are asking whether we are confronted by a cancer that has no immediate cure," he said. "The threat from terrorism is real, but we will overcome it."

Obama called on Muslim communities around the world to reject radicalism and IS ideology and to join in the fight against terrorism. He emphasized that there is no conflict between the West and Islam.

He said that the United States must not "live in fear" following the attack and must not turn on Muslims inside the country. Likewise, it must not impose religion-based restrictions on immigration.

Obama also called for tighter U.S. gun laws. He said people on the terrorist no-fly list should not be able to purchase assault weapons.

He said that the West's current strategy of air strikes against IS targets in Iraq and Syria can achieve a sustainable victory and cautioned that the United States must avoid being drawn into a "long, costly ground war" in either country.

He said the United States is working closely with allies around the world in an effort to cut off IS's sources of financing.

Some of the Republicans who are competing for their party's nomination for the 2016 presidential election reacted critically to Obama's speech.

Billionaire Donald Trump, who is currently leading in most polls, posted on Twitter: "Is that all there is? We need a new President -- FAST!"

Florida Senator Marco Rubio said Obama shouldn't have criticized Americans for discriminating against Muslims. On Fox News, Rubio said: "I think not only did the president not make things better tonight, I fear he may have made things worse in the minds of many Americans."