Washington (CNN) In the first few months of his administration, President Donald Trump asked then-acting Homeland Security Secretary Elaine Duke why he could not ban refugees from "f*****g Somalia" in a bout of rage at his Bedminster golf club.

The episode, detailed in the new book titled "Border Wars," reveals the President's belief that people from Somalia posed a danger to the US. Months earlier, Trump targeted foreign nationals coming to the US from eight countries, including Somalia, in his "travel ban" executive order.

"Both he and [Stephen] Miller seemed to have a particular dislike for Somalia, often citing it or its nationals when they spoke of the potential dangers of refugees and other immigrants," the book states.

CNN purchased a copy of "Border Wars," by The New York Times' Julie Hirschfeld Davis and Michael D. Shear, ahead of its official release.

In October 2017, weeks after Trump complained to Elaine Duke, the then-acting Homeland Security secretary received a call from White House senior policy adviser Stephen Miller who insisted that Duke "shut off refugee flows from 11 countries the administration had identified as high-risk," particularly Somalia, according to the book. Duke refused.

Read More