President Barack Obama on Wednesday called the slaying of American photojournalist James Foley at the hands of Islamic State militants “an act of violence that shocks the conscience of the entire world.”

FILE - This file photo posted on the website freejamesfoley.org shows journalist James Foley in Aleppo, Syria, in July, 2012.In a horrifying act of revenge for U.S. airstrikes in northern Iraq, militants with the Islamic State extremist group have beheaded Foley — and are threatening to kill another hostage, U.S. officials say. (AP Photo/freejamesfoley.org, Nicole Tung, File) NO SALES

This file photo posted on the website freejamesfoley.org shows journalist James Foley in Aleppo, Syria, in July 2012. In a horrifying act of revenge for U.S. airstrikes in northern Iraq, militants with the Islamic State extremist group have beheaded Foley — and are threatening to kill another hostage, U.S. officials say. (AP Photo/freejamesfoley.org, Nicole Tung, File)

Speaking one day after the terror group released a graphic video showing Foley being beheaded on camera, Obama vowed that the United States will be relentless in destroying them.

“When people harm Americans anywhere, we do what’s necessary to see that justice is done,” Obama said, speaking from Martha’s Vineyard. He called the Islamic State a “cancer” that must be extracted so it doesn’t spread.

Obama said he spoke with Foley’s family on Wednesday and that the entire country is “heartbroken at their loss.”

Obama said “no just God” would support the Islamic State slaughtering thousands in the name of religion, saying, “ISIL speaks for no religion.”

“They have murdered Muslims, both Sunni and Shia, by the thousands,” Obama said. “They target Christians and religious minorities, driving them from their homes, murdering them when they can’t, for no other reason than they practice a different religion. They declared their ambition to commit genocide against an ancient people.”

Obama said the Islamic State will not survive.

“They fail because the future’s won by those who build and not destroy and the world is shaped by people like Jim Foley and the overwhelming majority of humanity who are appalled by those who kill them,” he said.

Fred Lucas contributed to this report.

Other Must-Read Stories