WASHINGTON — He had just hung up the telephone with the devastated parents before heading in front of the cameras. Unusually emotional, President Obama declared himself “heartbroken” by the brutal murder of an American journalist, James Foley, and vowed to “be relentless” against Islamic radicals threatening to kill another American.

But as soon as the cameras went off, Mr. Obama headed to his favorite golf course on Martha’s Vineyard, where he is on vacation, seemingly able to put the savagery out of his mind. He spent the rest of the afternoon on the links even as a firestorm of criticism erupted over what many saw as a callous indifference to the slaughter he had just condemned.

Presidents learn to wall off their feelings and compartmentalize their lives. They deal in death one moment and seek mental and physical relief the next. To make coldhearted decisions in the best interest of the country and manage the burdens of perhaps the most stressful job on the planet, current and former White House officials said, a president must guard against becoming consumed by the emotions of the situations they confront. And few presidents have been known more for cool, emotional detachment than Mr. Obama.

Yet the juxtaposition of his indignant denunciation of terrorists and his outing on the greens this week underscored the unintended consequences of such a remove. If Mr. Obama hoped to show America’s enemies that they cannot hijack his schedule, he also showed many of his friends in America that he disdains the politics of appearance. He long ago stopped worrying about what critics say, according to aides, and after the outcry over Wednesday’s game, he defied the critics by golfing again on Thursday, his eighth outing in 11 days on the island.

It was all the more striking given that Prime Minister David Cameron of Britain canceled his vacation after the Islamic State in Iraq and Syria released the video showing Mr. Foley’s death because the accent of the masked killer suggested he came from Britain. Former Vice President Dick Cheney told Fox News that Mr. Obama would “rather be on the golf course than he would be dealing with the crisis.”

But the criticism went beyond the usual political opponents. Privately, many Democrats shook their heads at what they considered a judgment error. Ezra Klein, editor in chief of the online news site Vox, who is normally sympathetic to Mr. Obama, wrote on Twitter on Wednesday that “golfing today is in bad taste.” The Daily News published a front-page photograph of a grinning president in a golf cart next to a picture of Mr. Foley’s distraught mother and father under the headline, “Prez tees off as Foley’s parents grieve.”

“As a general rule, I think that he’s right that you can’t be held hostage to the news cycle — the man deserves a bit of downtime,” said Jim Manley, a longtime Democratic strategist. “But in this particular instance, I think a lot of Democrats flinched a little bit.”

The video, Mr. Manley added, “was just so shocking that the idea that he was going to immediately run to the golf course was just a little too much for folks; it was tone-deaf.”

Mr. Obama has traditionally resisted what he sees as the empty political gesture of abruptly upending his schedule in reaction to the latest crisis. Aides said the golf game did not reflect the depth of his grief over Mr. Foley, noting that the president had just spoken with his parents that morning. “His concern for the Foleys and Jim was evident to all who saw and heard his statement,” said Jennifer Palmieri, the White House communications director.

Video

A look at the next military steps the United States is considering in the battle against the Islamic State in Iraq and Syria.CreditCreditHasan Jamali/Associated Press

Mr. Obama is not the first president to get in trouble with a golf club in hand. On the course one day in 2002, President George W. Bush delivered a tough-worded statement denouncing a suicide bombing in Israel and then, barely missing a beat, told reporters, “Now, watch this drive.” Mr. Bush later concluded that such scenes sent a bad message, and in the fall of 2003, with the Iraq war raging, he gave up golf for the remainder of his presidency.

What really matters, according to Mr. Obama’s defenders, is not what the president does to blow off steam, but what he does to blow up ISIS. Aides to Republican and Democratic presidents have long argued that the commander in chief is on duty no matter where he is, and that even on vacation, he is receiving briefings, making phone calls and issuing orders. Other presidents have taken vacations during major crises and times of war. This year Mr. Obama has repeatedly interrupted his summer break to deal with Iraq and the racial unrest in Ferguson, Mo.

For Mr. Obama, the video of Mr. Foley’s death is acutely personal because it showed one of three other American civilians held hostage, Steven J. Sotloff, suggesting he would be killed next if the president did not stop bombing ISIS targets in Iraq. “The life of this American citizen, Obama, depends on your next decision,” the masked killer says while holding the back of Mr. Sotloff’s orange, prison-style shirt.

There could hardly be many more wrenching situations for a president. Sending American troops into harm’s way is difficult enough, but they at least volunteered for duty and are trained for the dangers they confront. The rise of social media has made such life-or-death blackmail all the more horrific. As far as aides knew, Mr. Obama did not watch the ISIS video, and advisers did not think he should.

“That’s got to be exquisitely disturbing,” said Peter D. Feaver, a former national security aide to Mr. Bush and President Bill Clinton, who now teaches at Duke University. “And it’s different than for average Americans who are watching this on television but know there’s nothing they can do. With President Obama, there are things he can do, but he’s concluded that he can’t do them.”

Bruce Hoffman, a terrorism expert at Georgetown University, said ISIS appeared to design its video to instill maximum fear in Mr. Obama and a country it perceives as exhausted by war. Mr. Obama’s forceful response on Wednesday, he said, was “a necessary and important one — that we’re not being intimidated, we’re not backing down.”

Including Mr. Sotloff in the video, Mr. Hoffman added, intensified the direct threat the group was sending the president. “They put the knife in, and they’re trying to twist it by making it personal,” he said.

Former presidents have been the subject of personal appeals from terrorists threatening American lives, from the Iran Embassy seizure under Jimmy Carter to the hijackings of T.W.A. Flight 847 and the Achille Lauro cruise ship under Ronald Reagan.

Mr. Obama, too, has faced this situation before. Warren Weinstein, an American development consultant abducted by Al Qaeda in Pakistan, appealed directly to the president in a video late last year. In May, Mr. Obama authorized a prisoner swap with the Taliban to secure the release of Sgt. Bowe Bergdahl after concluding that his life was at risk.

Frances Fragos Townsend, a former counterterrorism adviser to Mr. Bush, said it is important to avoid letting the president become too emotionally involved in such situations, adding that she would not have shown the ISIS video to Mr. Obama. “You fight very hard to not have it be personal,” she said. “You just don’t let them do that. They can use your name, and they can make it personal. But it’s not.”

A version of this article appears in print on , on Page A1 of the New York edition with the headline: A Terrorist Horror, Then Golf: Incongruity Fuels Obama Critics. Order Reprints | Today’s Paper | Subscribe