Rex Tillerson's mission was delicate but not unfamiliar as he phoned President Donald Trump last week: Persuade the boss to curb his own impulses on yet another potentially explosive national security issue.

Trump had stormed into the new year threatening on Twitter to cut off aid to the Palestinians after little Mideast peace progress. His U.N. ambassador, Nikki Haley, egged Trump on, pushing him to suspend all of a planned $125 million payment to the U.N. agency for Palestinian refugees. Tillerson's State Department and the Pentagon sought to preserve the full amount, fearful about the implications for millions of people and U.S. partner governments in the Middle East.

In a phone call this past Friday, the secretary of state sold the president on a compromise: Give half the money, put the rest on hold. It would allow Trump to say he followed through on a threat, without further destabilizing the Arab world.

For Tillerson, it was a strategy derived by trial and error over a tumultuous first year under a president whose instinct to rip up the traditional playbook continues to shock the foreign policy establishment. It's fallen to Tillerson, Defense Secretary James Mattis and national security adviser H.R. McMaster to soften some of Trump's most dramatic impulses, all while dealing with competing power centers and messy internal arguments that have repeatedly spilled into the open.

In the Palestinian case, it took an end run by Tillerson around Haley to ensure his word was the last. Trump previously had agreed to Tillerson's compromise. But Haley reached out to Trump personally and got him to change his mind. So after re-convincing Trump to accept the compromise, Tillerson worked to keep the decision a secret, according to five administration officials familiar with what happened.

Haley and most White House officials didn't get word until four days later, Tuesday, when the U.S. sent a letter to the U.N. body, said the officials, who weren't authorized to disclose internal deliberations and demanded anonymity.

The Palestinian aid episode was the latest example of the precarious balance Trump's team learned to strike during Year 1. Even as they coaxed Trump into preserving more of the Obama-era status quo than many expected was possible, they've had to navigate carefully around Trump's clear aversion to being publicly contradicted by staff or made to look feeble on the world stage.

So as America's national security leaders start Year 2, they're hoping they've finally cracked the code to working for Trump: designing strategies durable enough to confront the innumerable challenges of the present day — North Korea, Iran, Russia, Syria — yet flexible enough to accommodate a commander in chief who often veers wildly off-message.

"This president's different, and so everybody had to understand that this is going to be different," Tillerson said in a recent Associated Press interview. He said foreign leaders, too, have adjusted to Trump's unconventional style. "Now that we're a year into it, I think most of them have become rather accustomed to it."

Trump entered office vowing to pursue an unpredictable foreign policy. He hasn't disappointed. Through unorthodox and often undiplomatic comments, and approaches to everything from the NATO alliance to nuclear weapons, he repeatedly has sent his closest advisers scrambling to defuse tensions, avert potential conflict and contain damage.

Sometimes the damage spans continents, as with Trump's recent slurs against African nations and Haiti. Just as frequently, the tensions erupt within.

His national security team has been beset by rivalries: between former White House strategist Steve Bannon and Trump son-in-law/Mideast peace negotiator Jared Kushner; between Bannon and McMaster; Bannon and Tillerson; Tillerson and Kushner; Tillerson and McMaster; and Tillerson and U.N. envoy Haley.

One fundament of stability has been Tillerson's alliance with Mattis.

"They never go to a national security council meeting or to the president without being in agreement in advance themselves," Sen. Bob Corker, the Senate Foreign Relations Committee chairman, said in an interview. "So they're always on the same page."

Working in tandem, Tillerson and Mattis have tried to form the tempering force, quietly guiding the president toward more conventional decisions:

— Removing Iraq from his travel ban.

— Retaining and even expanding America's military presence in Afghanistan.

— Not moving the U.S. embassy to Jerusalem, after failing to stop Trump from recognizing the holy city as Israel's capital.

— Supporting diplomatic outreach to North Korea after Trump deemed talks a "waste of time."

— Keeping the Iran nuclear deal alive despite Trump's threats to withdraw.

— Recommitting to NATO even as Trump demanded more spending from allies.

— Allowing transgender troops to enroll and serve openly as court cases play out, despite Trump's Twitter declaration of a ban.

Many of these matters originated in Trump campaign promises and tweets, apparently intended to rev up his base. Critics fear such political considerations have dangerously superseded delicate questions of diplomacy and informed policy-making needed to protect the United States.

"President Trump has spent the last year trying to upend the very international system the United States built after World War II to create a world safe for Americans, our interests and our allies," said Sen. Ben Cardin, the top Democrat on the Senate Foreign Relations Committee.

Publicly, at least, Trump's aides take his impulsiveness in stride. Tillerson told an audience at Stanford University this week that since he doesn't track Trump's tweets in real time, his staff prints them out for him to read later, once world reaction has started pouring in. He said he considers the tweets "information" that he then uses to advance the Trump administration's pre-existing objectives.

After all, no one doubts whose show this really is.

"If people don't remember who the 69th secretary of state was 20 years from now," Tillerson said in the AP interview, "it's not going to bother me one bit."

___

Associated Press writers Lolita C. Baldor and Robert Burns contributed.