For two years, they tried to tutor and confine him.
They taught him history, explained nuances and gamed out reverberations.
They urged careful deliberation, counseled restraint and prepared talking points to try to sell mainstream actions to a restive conservative base hungry for disruption.
But in the end, they failed.
For President Donald Trump, the era of containment is over.
One by one, the seasoned advisers seen as bulwarks against Trump's most reckless impulses have been cast aside or, as Defence Secretary Jim Mattis did last week, resigned in an extraordinary act of protest.
What Senate Foreign Relations Committee Chairman Bob Corker, R-Tenn, once dubbed an "adult day care centre" has gone out of business.
Trump will enter his third year as president unbound - at war with his perceived enemies, determined to follow through on the hard-line promises of his insurgent campaign and fearful of any cleavage in his political coalition.
So far, the result has been disarray.
The federal government is shut down. Stock markets are in free fall. Foreign allies are voicing alarm. Hostile powers such as Russia are cheering. And Republican lawmakers once afraid of crossing this president are now openly critical.
"I want him to be successful, but I find myself in a position where the best way I can help the president is to tell him the truth as I see it," Sen. Lindsey Graham, R-SC, a Trump confidant and frequent golf partner, said as he denounced the president's abrupt decision to withdraw US troops from Syria against the counsel of his military advisers.
Trump is surrounding himself with "yes" men and women - at least relative to Mattis and other former military generals who tried to keep him at bay - who see their jobs as executing his vision, even when they disagree.
He has designated some officials, including the new White House chief of staff, Mick Mulvaney, as "acting," meaning they must labor to please the president to eventually be empowered in their positions permanently.
And he is railing against his handpicked chairman of the Federal Reserve, Jerome Powell, whom he blames for the sliding market and says he never should have chosen.
Meanwhile, Trump's family members are ascendant.
Son-in-law Jared Kushner is an increasingly influential interlocutor with foreign governments, such as Saudi Arabia, and was dispatched, along with Vice President Mike Pence and Mulvaney, to the Capitol on the eve of the government shutdown to try to negotiate a spending deal with congressional leaders.
The increasingly isolated president explained his mind-set in a November 27 interview with The Washington Post: "I have a gut, and my gut tells me more sometimes than anybody else's brain can ever tell me."
Earlier this year Trump began rejecting the advice of such economic advisers as Gary Cohn, who resigned in March, and instead followed his nationalist instincts to implement tariffs.
But the departure of Mattis and the national security implications that come with it sent a shock of anxiety through Washington and world capitals that far exceeded the worries over Trump's earlier trade moves.
"This is a rogue presidency," said Barry McCaffrey, a retired four-star Army general.
"We've got Mr Trump who looks, in the eyes of our allies and of the professionals in the key elements of our national security power, to be incompetent and impulsive and to be making bad decisions and to be excoriating America's historic allies and then embracing people who are threats to US national security," he said.
Senate Minority Leader Charles Schumer, D-NY, called this "the most chaotic week of what's undoubtedly the most chaotic presidency ever in the history of the United States."
In a speech Friday, he added: "The institutions of our government lack steady and experienced leadership. With all of these departures, it is about to get even more unsteady.
"The president is making decisions without counsel, without preparation, and even without communication between relevant departments and relevant agencies."
Consider the recent departures.
Mattis, a revered former Marine Corps general who commanded respect worldwide, especially among NATO countries, quit after Trump defied him on the Syria withdrawal.
His resignation letter was a stunning rebuke of Trump's worldview, which he presented as a threat to the global order the United States helped build over the past seven decades.
John Kelly, another Marine Corps general widely respected for his battlefield experience, was ousted earlier this month as White House chief of staff after running afoul of Trump, who chafed against Kelly's restrictive management style.
After being turned down by a number of other candidates, Trump tapped Mulvaney to replace Kelly - temporarily, at least. Mulvaney has vowed to Trump that he would try to manage only the staff, not the president.
Nikki Haley, who as ambassador to the United Nations showed flashes of independence and was far more aggressive with Russia and other traditional American adversaries than the president, is leaving this month on her own accord.
Trump nominated as her replacement Heather Nauert, a onetime Fox News Channel presenter who has been delivering the administration's message as State Department spokeswoman.
Earlier this year, Trump pushed out H.R. McMaster as national security adviser, replacing the Army lieutenant general and military intellectual with John Bolton, a neoconservative veteran of the George W. Bush administration who officials say has proven more accommodating than McMaster of Trump's impulses.
"Trump wants total freedom to do what he wants when he wants and he's much closer to getting that, which is what will terrify not only Congress but the rest of the world as well," said Thomas Wright of the Brookings Institution.
Rex Tillerson, Trump's first secretary of state and a longtime corporate executive, recently described the futility of trying to contain Trump.
He said Trump is "pretty undisciplined, doesn't like to read, doesn't read briefing reports, doesn't like to get into the details of a lot of things, but rather just kind of says, 'This is what I believe.'"
In an onstage interview earlier this month with Bob Schieffer of CBS News, Tillerson explained, "So often, the president would say, 'Here's what I want to do, and here's how I want to do it,' and I would have to say to him, 'Mr President, I understand what you want to do, but you can't do it that way. It violates the law.'"
Trump fired Tillerson in March after months of tension and replaced him with Mike Pompeo, who has a better personal rapport with the president.
"In Trump's mind, and those of some of his supporters, he's shedding those establishment figures who have prevented him from following his instincts and fulfilling his campaign pledges," said David Axelrod, a political strategist and White House adviser to former president Barack Obama.
"But his instincts are impulsive, almost always grounded in his own narrow politics and often motivated by spite. An unbridled Trump is a frightening proposition."
At the same time, some institutional checks on Trump's impulses are under duress. Trump's decision to remove troops from Syria blindsided Gen. Joseph Dunford Jr, the chairman of the Joint Chiefs of Staff, because he was kept out of final discussions.
House Speaker Paul Ryan, R-Wis, and Senate Majority Leader Mitch McConnell, R-Ky, after securing from the White House what they believed to be a short-term spending compromise, were unable to prevent a government shutdown once Trump reversed course in reaction to criticism from Rush Limbaugh, Ann Coulter and other conservative firebrands.
"This is tyranny of talk radio hosts, right?" Corker asked reporters.
The retiring senator then wondered aloud, "Are Republicans really going to trust the guy that comes out of the White House on a go-forward basis? I mean, this is a juvenile place we find ourselves at."
Some of Trump's former advisers and outside allies share the same concern about the president's recent behavior.
One former senior administration official said "an intervention" might be necessary.
And a Republican strategist who works closely with the White House called the situation "serious, serious, serious".
This strategist, who spoke on the condition of anonymity to be candid, drew comparisons to the presidencies of Richard Nixon and George W. Bush.
"There are no adults like there were in Nixon days," this strategist said.
"And the VP is perceived as nowhere. He's just a bobblehead. It's not like [former vice president Richard B.] Cheney."
Since his drubbing in the midterm elections six weeks ago, Trump has been preoccupied with worries about his political survival.
Democrats take over the House on January 3, promising a torrent of investigations into Trump's conduct, his personal finances and alleged corruption throughout his administration.
Meanwhile, various federal investigations are intensifying.
Special counsel Robert Mueller III's Russia investigation has moved into a more perilous phase. That probe, as well as a federal investigation into illegal hush-money payments to women who claimed sexual encounters with Trump, have ensnared his personal lawyer Michael Cohen, national security adviser Michael Flynn and campaign chairman Paul Manafort, among others.
In a separate case, Trump agreed to shut down his family charitable foundation last week after New York Attorney General Barbara Underwood said it engaged in "a shocking pattern of illegality".
Ian Bremmer, a foreign affairs expert and president of the Eurasia Group, posited that despite the global reaction to Mattis' exit, the ouster last year of Stephen Bannon as chief White House strategist was the more significant episode.
"The reduction in potential damage of the Trump administration could exact on the world from Bannon's firing is significantly greater than the additional chaos and danger that comes from Mattis' resignation," Bremmer said.
"Bannon actually was a compelling individual with a lot of influence and power in Trump's ear that wanted to really upset the apple cart in US foreign policy."
Still, alarm bells rang last week throughout the foreign policy establishment.
The resignation of Mattis was held up as a singular moment. Eliot A. Cohen, a senior State Department official in the Bush administration and Trump critic, wrote in the Atlantic, "Henceforth, the senior ranks of government can be filled only by invertebrates and opportunists, schemers and careerists."
"They may try to manipulate the president, or make some feeble efforts to subvert him," Cohen added, "but in the end they will follow him."