President Obama denounced the Islamic State’s beheading of an American journalist as an uncivilized act that has "no place in the 21st century" and vowed to continue confronting the group in Iraq or elsewhere whenever it threatens U.S. citizens.

"We will continue to confront this hateful terrorism and continue to replace it with hope and civility — that’s what Jim Foley stood for," he said Wednesday during a break from his vacation on Martha's Vineyard.

He also described the terrorist group's ideology as morally "bankrupt" and said the "world is appalled" by the Islamic State's brutality.

"No just God would stand with what they did yesterday or what they do every single day" in slaughtering innocent women and children, slaying other Muslims and targeting ethnic minorities for genocide, he said.

Obama also offered his condolences to the parents and friends of James Foley, a photojournalist who vanished in Syria two years ago. The Islamic State released a video Tuesday showing Foley’s beheading.

"Jim was taken from us in an act of violence that has shaken the whole world," he said. "We are all heartbroken at their loss and join them in honoring Jim and all that he did."