The speech was written. A cast of relatable Americans with emotional stories was standing by to reinforce the message. But President Donald Trump was in no mood to play along.

"The hell with it," Mr. Trump said, recounting the scene with his aides to a West Virginia crowd last week, Mr. Trump tossed the staff-prepared remarks on tax cuts in the air and ducked as the paper fluttered to the floor. "I said, 'This is boring, come on.' Tell it like it is."

This president has never been one to stick to a script, but that abandoned speech illustrates a new phase in Mr. Trump's presidency. He is increasingly at odds with his staff — and growing wise to their tactics.

Get Breaking News Delivered to Your Inbox

One favored staff strategy: Guide the president to the right decision by making the conventional choice seem like the only realistic option. Except now, 14 months into his administration, Mr. Trump is on to them, and he's making clear he won't be boxed in.

That was the message that an irritated Mr. Trump delivered to his national security team last week in a classified meeting about U.S. involvement in Syria.

Mr. Trump's advisers, among them Defense Secretary Jim Mattis and the chairman of the Joint Chiefs of Staff, Gen. Joseph Dunford, were advocating for an ongoing U.S. military presence to provide stability. They aimed to rely on the same playbook they used last year in persuading Mr. Trump to keep U.S. troops in Afghanistan indefinitely. They would paint a dire picture of a pullout, of regional chaos benefiting Russia and Iran, and the potential resurgence of the Islamic State group.

But even before they could begin their pitch in that meeting Tuesday, Mr. Trump headed them off, saying he wanted to remove U.S. troops immediately. The ensuing heated argument put new distance between the president and his team and left the military with a mandate, if not a formal order, to remove U.S. troops from Syria within six months.

The episode stood in sharp contrast to the earlier meeting on Afghanistan, when Mr. Trump went along with his advisers despite his instincts to pull out completely.

More than 10 current and former White House officials and outside advisers spoke to AP on condition of anonymity to describe such internal discussions.

The shift has as much to do with changes in personnel as changes in the president's attitude. Former White House staff secretary Rob Porter, for one, was viewed as a person Mr. Trump could trust to be an honest broker and make sure that all options were being faithfully presented to him.

During the Afghanistan meeting, aides went out of their way to make it appear that they were considering Mr. Trump's perspective with an even hand. But with Syria, aides said, Mr. Trump felt he was being steamrolled and lashed out.

Managing a boss who despises being managed is a difficult game. And those who have succeeded have proceeded carefully. Some aides, convinced that Mr. Trump puts more stock in what he sees on TV than in his own aides' advice, regularly phone prominent commentators and news hosts to provide talking points on everything from tax policy to Syria in hopes of influencing Mr. Trump. Similar strategies have also been embraced by foreign governments and outside groups trying to sway the president's thinking.

Stall tactics were favored by Mr. Trump's first chief of staff, Reince Priebus. He often told Mr. Trump that staffers needed more time to work on a proposal or that it would be better put off until the next week, hoping Mr. Trump would change his mind or forget.

Indeed, as Mr. Trump considered the impact of tariffs on steel and aluminum imports and on some imports from China, his free-trade-supporting aides hoped they could wait him out.

But Mr. Trump, fed up with aides who were pleading for more time on tariffs, blew up.

In the chaotic aftermath of Porter's departure, Commerce Secretary Wilbur Ross and hawkish trade adviser Peter Navarro encouraged Trump to take protectionist action. Aides including Treasury Steve Mnuchin and then-National Economic Council Director Gary Cohn, whose actions some aides compared to "hiding the ball," were suddenly left scrambling to devise a rear-guard action. Cohn resigned days later when it became clear that tariffs were imminent.

Of course Mr. Trump isn't the only president whom aides have tried to roll, particularly when it comes to national security. The Pentagon has a history of presenting a range of options, some extreme, and trying to steer a president to its preferred policy.

In 2009, a new president, Barack Obama, wrestled for months with competing advice from his national security team on how to turn around the stalemated war in Afghanistan before deciding on a compromise plan to send 30,000 more troops in an escalate-to-exit strategy. Obama suspected the military of leaking details of National Security Council deliberations to press him into accepting a bigger troop surge. The internal acrimony over troop increases reached a point, Robert Gates wrote in his memoir, "Duty," that he came closer to resigning than at any other time in his tenure as Obama's defense secretary.

Some aides insist that Mr. Trump has long been aware of his staff's management strategies, and was merely playing along with their schemes. But the recent changes in how Mr. Trump interacts with his staff have also been driven by a shake-up in White House personnel that includes the weakening of the chief of staff, John Kelly.

Over the last six weeks, the decision-making process overseen by Porter has largely broken down, giving Mr. Trump's outside confidants a new opening.

Some of those outsiders were once insiders. Now gone, they've seized the opportunity to influence Trump once again.