WASHINGTON — The retired general brought in to instill order at a chaotic White House made a rare public appearance Thursday to declare he's staying in his post — and to insist that the president's volatile Twitter feed wasn't making his job harder.

"Unless things change, I'm not quitting, I'm not getting fired and I don't think I'll fire anyone tomorrow," chief of staff John Kelly told reporters during a surprise showing at the daily White House briefing. "I don't think I'm being fired today, and I'm not so frustrated in this job that I'm thinking of leaving."

The extraordinary statement drew a bit of laughter, but it reflected ongoing turmoil in the top ranks of a White House riven by staff changes, internal feuds and reports that Kelly is growing increasingly frustrated in his position.

Trump, in turn, has at times chafed at Kelly's efforts to reign in the freewheeling, open-door style that marked his business career and early months in the White House.

The president has taken to leaving the Oval Office at times to engage aides, solicit opinions and re-create the unfettered feeling he has told allies he misses, according to two people who have spoken recently to the president but were not authorized to discuss private conversations.

Kelly pushed back against recent reports that he and Trump were clashing but acknowledged he has organized the White House more tightly and changed how people interact with the president.

"I restrict no one, by the way, from going in to see him," Kelly said. "But when we go in to see him now, rather than the onesies and twosies, we go in and help him collectively understand what — what he needs to understand to make these vital decisions."

Kelly called his chief of staff position the hardest and the most important job he's ever held — but not the best one. That would be enlisted Marine sergeant infantryman.

Kelly's 23-minute appearance, the latest in a series of public proclamations of loyalty to Trump from his underlings, underscored the challenges he faces working for an ideologically flexible and at times bellicose president.

He said he hoped for a diplomatic solution to the North Korea crisis even though Trump has ridiculed the notion. He insisted that the White House "will stand with those American citizens in Puerto Rico until the job is done" just hours after Trump appeared to threaten to end relief efforts to the hurricane-ravaged island. And he denied that Trump's impulsive and sometimes inflammatory tweets made his job more difficult but insisted he made no effort to curb them.

Kelly said he's read that "I've been a failure at controlling the president, or a failure at controlling his tweeting, and all that." But he added that he was "not brought to this job to control anything but the flow of information to our president, so that he can make the best decisions."

Despite Kelly's public proclamations, there have been moments of friction between the men.

Trump has grown irritated with some of the restrictions placed on him by Kelly and has vented to friends that he does not like the media depiction of the chief of staff cleaning up a dysfunctional White House, according to the people who have spoken with him.

Kelly, meanwhile, has been dismayed by Trump's sniping at fellow Republicans and his focus on culture war issues, like NFL players kneeling during the national anthem, that distract from his legislative agenda. But the chief of staff insisted that widely-shared photos of him appearing frustrated during Trump's speeches — including one that depicted him with his head in his hands during the president's address to the U.N. General Assembly — do not reflect his actual mood.

"You guys with the cameras always catch me when I'm thinking hard, and it looks like I'm frustrated and mad," Kelly said to laughter, his Boston accent poking through.

He was far more serious when discussing some of the challenges facing the administration and nation. Kelly said North Korea was his foremost concern, fearful that its burgeoning nuclear program could inspire other nations to follow suit. He declared that Pyongyang "simply cannot" be allowed to develop weapons that could reach the U.S. mainland.

"Right now, we think the threat is manageable," Kelly said. But he added, "Let's hope diplomacy works."

Kelly also channeled his boss by saying that inaccurate media reports are his greatest "frustration" in the job. He urged reporters to "get better sources."

Hours later, Trump tweeted about the news media, writing "People are just now starting to find out how dishonest and disgusting (FakeNews) @NBCNews is. Viewers beware. May be worse than even @CNN!" Trump in recent days has pushed back hard against unflattering reports by NBC News. He previously has referred to CNN as "fake news."