Donald Trump's second travel ban, which restricts entry into the United States by individuals from six countries and kicks in on Friday, is built on assessments from intelligence agencies the president has attacked and sometimes ignored since taking office.

The administration's second entry prohibition adds Eritrea, Kyrgyzstan, Nigeria and Myanmar to its first travel ban, which singles out individuals from five majority Muslim countries. It also restricts individuals hailing from Tanzania and Sudan from getting green cards via the visa lottery program that Mr Trump has panned.

Mr Trump's first travel ban – which the administration was forced to revamp several times – was upheld by the US Supreme Court. That gives critics like Democratic lawmakers and pro-immigrant groups little chance of taking down the second version.

Though it soon will be official US policy, the new restriction program represents the latest contradiction of the Trump presidency because it was constructed on a rationale that overwhelmingly depends on the US intelligence community.

A White House proclamation that accompanied the second ban builds a legal case and operational description of why the administration determined it is needed and how it will be implemented. That document states it is based on "improvements" to Department of Homeland Security threat assessment metrics also used to craft the first ban.

Donald Trump celebrity president: A decade in two halves Show all 29 1 /29 Donald Trump celebrity president: A decade in two halves Donald Trump celebrity president: A decade in two halves Trump styles his 'You're fired!' pose in his Trump Tower office in June 2012. At the time he was known as a reality TV star on The Apprentice Diane Bondareff/Invision/AP Donald Trump celebrity president: A decade in two halves He was also well known as the patron of the Miss Universe competition Getty Donald Trump celebrity president: A decade in two halves Early signs of Trump's ambition for the presidency can be found everywhere. Not least in his 2011 book 'Time to get tough: Making America #1 again' Getty Donald Trump celebrity president: A decade in two halves Trump with Piers Morgan in November 2010. Piers Morgan has long held that he and Trump are good friends Getty Donald Trump celebrity president: A decade in two halves Trump appeared on Fox & Friends, his favourite show, in August 2011 Getty Donald Trump celebrity president: A decade in two halves Trump considered running in the 2012 election, where he would have faced Barack Obama. He is speaking here at an event for a Republican women's group Getty Donald Trump celebrity president: A decade in two halves Trump was subject to a Comedy Central roast in 2011. He is pictured here being roasted by rapper Snoop Dogg Getty Donald Trump celebrity president: A decade in two halves Given that this Trump store is in the lobby of Trump Tower, it can be said that Trump sells merchandise of himself out of his own home Getty Donald Trump celebrity president: A decade in two halves Trump held meetings with prominent Republicans when considering his 2012 bid. He is pictured here with Alaska governor Sarah Palin Getty Donald Trump celebrity president: A decade in two halves He didn't end up running in 2012 afterall, instead endorsing Republican candidate Mitt Romney AFP/Getty Donald Trump celebrity president: A decade in two halves Trump's golf course in Aberdeen proved controversial in 2012 when he began lobbying the Scottish government against wind power in order that they wouldn't install turbines off the shore by his new course Getty Donald Trump celebrity president: A decade in two halves He even gave evidence to a Scottish parliamentary committee discouraging wind energy AFP/Getty Donald Trump celebrity president: A decade in two halves He still found time for a round of course AFP/Getty Donald Trump celebrity president: A decade in two halves On 16 June 2015, Trump announced that he would run for the presidency of the United States in the 2016 election as a Republican Getty Donald Trump celebrity president: A decade in two halves His campaign was divisive, courting controversy wherever he went. Ultimately he was declared the Republican candidate in June 2016 Getty Donald Trump celebrity president: A decade in two halves Trump took part in the TV debate against opponent Hillary Clinton on 9 October Getty Donald Trump celebrity president: A decade in two halves Trump and wife Melania vote in the presidential election on 8 November 2016 AFP/Getty Donald Trump celebrity president: A decade in two halves Hillary Clinton conceded defeat at 2:50am on 9 November and president-elect Trump swiftly delivered his victory speech to a crowd of supporters Getty Donald Trump celebrity president: A decade in two halves News coverage around the world focused on the huge political upset that Trump's victory spelled AFP/Getty Donald Trump celebrity president: A decade in two halves Trump met with president Obama to discusss transition planning on 10 November. AFP/Getty Donald Trump celebrity president: A decade in two halves Donald Trump and Nigel Farage pose in the golden elevator at Trump Tower on 12 November 2016. Farage was the first British politician to meet with Trump after the election LeaveEUOffical/Twitter Donald Trump celebrity president: A decade in two halves The inauguration of Donald Trump took place on 20 January 2017. Trump's press secretary Sean Spicer boasted that the crowd was the 'largest ever' to witness an inauguration, a claim that was proved not to be true Getty Donald Trump celebrity president: A decade in two halves In his first 100 days as leader, Trump signed 24 executve orders, the most of any president AFP/Getty Donald Trump celebrity president: A decade in two halves One of Trump's most memorable election pledges was to build a wall between the US and Mexico. He is standing here in front of a prototype for a section of the wall Getty Donald Trump celebrity president: A decade in two halves Trump's meetings with other world leaders have provided no short supply of photo opportunities Getty Donald Trump celebrity president: A decade in two halves Trump was welcomed to the UK by the Queen and a state banquet was held at Buckingham Palace in his honour Reuters Donald Trump celebrity president: A decade in two halves Not everyone welcomed the president. Mass protests were held in London throughout his visits in both 2018 and 2019 EPA Donald Trump celebrity president: A decade in two halves One of the most significant meetings Trump has held with another leader was with North Korea's Kim Jong Un. In June 2019, Trump became the first sitting president to set foot in North Korea Getty Donald Trump celebrity president: A decade in two halves 2020 will see president Trump fight for a second term in office, who knows what the next decade will bring? Getty

But it also was crafted with "more customized data from the United States Intelligence Community," according to the White House.

"With the benefit of two years of experience, DHS has worked closely with the Intelligence Community to define intelligence requirements and customize intelligence reporting that offers a detailed characterization of the relative risk of terrorist travel to the United States from each country in the world," states the proclamation. "This additional detail improves DHS's assessment of national security and public-safety risk."

The White House and president, then, are depending on an intelligence apparatus to justify and provide the backbone of the second ban that he has at times attacked, alienated, ignored or mocked.

During a January 9 campaign rally, the president told supporters about the US military operation that killed Qassem Soleimani, the Iranian general who commanded the country's Quds Force.

"One of our leaders, one of our really admired people said, 'Sir, we'll have them there tomorrow.' I said, 'No, get in the planes right now. Have them there immediately,'" Mr Trump claims he told senior US national security officials. "And they got there immediately."

Mr Trump's second travel ban depends heavily on intelligence agencies Mr Trump also sought to discredit during House Democrats' impeachment inquiry.

Testimony by Fiona Hill, a former National Security Council Russia expert, and David Holmes, an official in the US embassy in the Ukrainian capital, further undercut several contentions pushed by Trump, GOP lawmakers and the president's surrogates. Hill, for instance, dismissed a conspiracy theory rejected by American intelligence agencies but espoused by Trump and other Republicans that Ukraine, not Russia, meddled in the 2016 US election.

Mr Trump also has long broken with all 16 American intelligence agencies' finding that Russia interfered in that very election with a goal of boosting his bid over that of former Secretary of State Hillary Clinton.

He angered some intel officials early in his first year when he invited a group of senior Russian officials into the Oval Office and boasted about highly classified information.

In January 2018, the president broke with his own intelligence agencies when he suggested lawmakers allow the Foreign Surveillance Intelligence Court, used in complicated terrorism cases, to expire.

"This is the act that may have been used, with the help of the discredited and phony Dossier, to so badly surveil and abuse the Trump Campaign by the previous administration and others?" he tweeted.

After an intervention with senior officials, he was forced to walk that back in a second tweet. The House and Senate soon voted to reauthorize the sometimes-controversial FISA process.

When the second ban makes it more difficult for thousands of additional people from non-white majority countries to enter the United States, he will be putting ample stock in an intelligence community two experts say he has long tried to "blind."