US President Donald Trump's elevation of his chief political strategist to a major role in national security policy, and a White House order banning refugees from certain Muslim-majority countries from US entry, appeared to come together as cause and effect over the weekend.
Stephen Bannon - whose nationalist convictions and hard-line oppositional view of globalism have long guided Trump - was directly involved in shaping the controversial immigration mandate, according to several people familiar with the drafting.
The order, which has ignited sweeping domestic and international backlash, came without the formal input of Trump's National Security Council, the committee of top national security aides designed to ensure the president examines all policy issues from different perspectives.
In Trump's case, the NSC has not yet been fully formed. Key department heads, including the secretary of state, have either not been confirmed or had little chance to be briefed by those under them.
But even as the mechanism for full consultation with defence, diplomatic, intelligence and other national security chiefs remains incomplete, Bannon's policy influence was established in a presidential directive that gave him something no previous president has bestowed on a political adviser: a formal seat at the NSC table.
The same directive appeared to downgrade the status of the chairman of the Joint Chiefs of Staff and the director of national intelligence - the president's senior intelligence and military advisers under statute - by limiting their attendance to some meetings.
Former President Barack Obama's national security adviser, Susan Rice, called the measure "stone cold crazy" in a tweet. Former Obama defence secretary and CIA director Robert Gates, who said he was unconcerned about Bannon's role, told the ABC that "pushing [the DNI and Joint Chiefs chairman] out of the National Security Council meetings, except when their specific issues are at stake, is a big mistake".
Every president finds their judgment useful, "whether they like it or not," Gates added.
A senior NSC official said that negative interpretations of both measures misunderstood both the intention and the effect of a directive whose overall aim was to make policy formation more inclusive and more efficient.
Bannon "is a trusted adviser," said the official. "He's got substantial policy responsibilities, and I think it's very important that he is there to hear and to provide context to what is going on."
"I think, candidly, that things in Washington, everything is political," this official said. "We wanted to make sure that all viewpoints were considered at critical points."
Despite his listing in the NSC organisational chart, Bannon "doesn't have to be there all the time," the official said.
The intelligence and military chiefs, the official said, "are invited as attendees to every single NSC meeting ... There's nowhere in that document that says they are excluded."
While they are listed as attendees to meetings of the NSC - the highest decision-making body, chaired by the president - the directive says they will attend meetings of the national security principals meeting without Trump "where issues pertaining to their responsibilities and expertise are to be discussed".
In surveying senior officials from previous administrations, those charged with organising the NSC were frequently told meetings were too frequent, too long and often inconclusive, and that officials were "tired of nano-management," the official said of Obama-era complaints that were well-reported at the time.
K.T. McFarland, the deputy national security adviser, began her first meeting of NSC deputies by saying that " 'this going to be tight . . . 90 minutes. You're going to come in, going to have your positions, going to be a decision-making body.' The feedback we got was great," the official said.
The directive, based on a template that all modern presidents have used in organising national security decision-making, changed a number of things from the Obama White House. From 23 deputy national security advisers under Obama, there are now only six under Trump national security adviser Michael Flynn, dealing with regions, issues including cyber and counterterrorism and functions such as legal matters.
Some offices such as cyber have been expanded, while others have been collapsed. Obama's separate directorates on Europe and Russia have now been combined, the official said.
While Obama was criticised for the size of his NSC staff, and Congress enacted legislation to shrink the number of bodies, Rice cut it by about 17 per cent in recent years to fewer than 180 policy positions. Trump's is unlikely to be much smaller, the official said, and numbers were a secondary consideration. All positions on the White House payroll have now been filled, and those detailed from other agencies - usually appointed for two-year secondments - will eventually rotate out.
Outside the White House, reaction to the new NSC organisational directive was less positive, with some saying that the immigration directive suffered from jumping ahead of the normal policy process.
That meant it and other orders were composed by political operatives such as Bannon and Stephen Miller, the White House senior adviser for policy, who is a Bannon ally and a former aide to Senator Jeff Sessions, Trump's populist and conservative nominee for attorney-general.
Senior Trump officials offered differing public explanations for the Bannon appointment. Asked what the strategist contributed to NSC discussions, White House press secretary Sean Spicer said that Bannon "is a former naval officer. He's got a tremendous understanding of the world and the geopolitical landscape that we have now".
Asked if Bannon was "giving advice" on national security matters, Spicer said he was contributing analysis. "It's about the intelligence that comes in and the analysis that comes out of that," he said. "Having key decision-makers, and the chief strategist for the United States for the president to come in and talk about what the strategy is going forward is crucial."
Bannon has no job experience in foreign policy. After serving in the Navy for seven years in the late 1970s and early 1980s, his eclectic career took him to Goldman Sachs, to consulting to documentary filmmaking and then to the running of Breitbart News, a far-right website known for peddling conspiracy theories.
From his perch as chief of the Breitbart News empire, which produced a satellite radio show, Bannon cemented his role as a champion of the alt-right, an anti-globalism movement that has attracted support from white supremacists and helped power Trump's populist White House victory.
Trump sees Bannon as a generational peer who shares his anti-establishment instincts and confrontational style.
According to several people familiar with their relationship, Bannon has cultivated a rapport with Trump over security issues in recent months, and impressed Trump with his grasp of policy in talks they have held together with top intelligence and military officials.
The new president relies on Bannon to ensure that his campaign promises and nationalist worldview are being followed and are shaping national security strategy.
Trump's approval of Bannon's new role is seen inside the White House as the formalisation of a dynamic that has already been at work for weeks, these people said.
For many outside the White House, the optics of Bannon's NSC appointment were bad, regardless of the motivation or the substance of his participation.
In previous administrations, political advisers have been banned from national security discussions - or at least not publicly acknowledged.
George W. Bush barred his political strategist, Karl Rove, from NSC meetings, according to Josh Bolten, Bush's chief of staff. "The president told Karl Rove, 'You may never come to a National Security Council meeting,' " Bolten said at a conference on the NSC and politics last fall.
"It wasn't because he didn't respect Karl's advice or didn't value his input," Bolten said. "But the president also knew that the signal he wanted to send to the rest of his Administration, the signal he wanted to send to the public, and the signal he especially wanted to send to the military is that the decisions I'm making that involve life and death for the people in uniform will not be tainted by any political decisions."
While Obama did not include political strategist David Axelrod in his own NSC organisational directive, Axelrod frequently showed up at the meetings - particularly those having to do with strategy in Afghanistan and Iraq - to the consternation of Gates and others.
"It is true that the Obama Administration did it," said Peter Feaver, a political science professor at Duke University who served on the Bush NSC staff.
"It's also true that we Republicans, myself included, sharply criticised them for doing it, precisely on the grounds that you are feeding the image that politics drove the decision."