President Obama said he was near tears while talking to the parents of slain U.S. journalist James Foley, and he appeared to express some misgivings about his decision to play golf minutes after delivering an angry public statement about Foley's killing in Syria three weeks ago.

"I should've anticipated the optics," Obama said in an appearance on NBC's "Meet the Press" set to air Sunday.

"Part of this job is also the theater of it," Obama said, adding that "it's not something that always comes naturally to me.  But it matters."

The president had been on vacation in Martha's Vineyard Aug. 20 when he appeared before assembled reporters and pronounced himself "heartbroken" over Foley's beheading by fighters for the Islamic State militant group in Syria.

Minutes after his remarks, Obama arrived at a golf course, where he played a round with several friends, provoking criticism from some political rivals, Democratic allies and media pundits that the commander in chief had not treated the moment with proper dignity and respect.

Obama and his advisers have generally dismissed criticism about his leisure activities, noting that all presidents have enjoyed pastimes that can help them clear their heads for a job that never really has off-hours. The president spent nearly two weeks in Martha's Vineyard and played nine rounds of golf there.

"The possibility of a jarring contrast, given the world's news, is always -- there's always going to be some tough news somewhere -- is going to be there," Obama said. "I think everybody who knows me, including, I suspect, the press, understands that that, you know, you take this stuff in.  And it's serious business.  And you care about it deeply."

The president emphasized that "the important thing is, in addition to that, is am I getting the policies right? Am I protecting the American people? Am I doing what's necessary? And when it comes to the policies, when it comes to the actions we've taken, I have no higher priority than keeping the American people safe. I think I've done a very good job during the course of these last, close to six years, doing so. And I intend to continue to meet that responsibility or meet that duty, for as long as I have the privilege of holding this office."