Within the first two years of his presidency, President Barack Obama encountered a host of unforeseen foreign policy problems including the prospect of a missing nuke in Pakistan, according to new revelations in "Confront and Conceal," David E. Sanger's book about the president's "secret wars" and his "surprising use of American power."

The book, released on Tuesday, underscores the complexity of the foreign policy issues Obama inherited and the extent to which he -- and whoever is commander-in-chief -- sometimes makes critical calls on the fly. It also illustrates a man who, according to Sanger, is unafraid to use unilateral force, even at the risk of violating a country’s sovereignty.

In the first summer after he took office, Obama was faced with the nightmarish scenario of having to hunt down a missing nuke in Pakistan, which some rank as the world’s most dangerous country. The president had been briefed about an "emerging intelligence picture" revealing that the Tehrik-i-Taliban, one of the Pakistani Taliban’s most violent extensions, may have gotten its hands on a nuclear weapon. In a follow-up meeting, intelligence briefers told Obama it was likely a "dirty bomb" -- radioactive material that can be wrapped around conventional explosives that would cause low casualties but carry enormous psychological impact. The difference between a dirty bomb and a nuclear explosion were unbeknownst to most, including some of the American officials themselves.

Shortly before the report was circulated, Chuck Todd had pressed Obama on the chance that the Taliban gets into Pakistan's nuclear arsenal. In a testy exchange, the president responded in no uncertain terms that he would not engage in hypotheticals and was confident no such incident would occur. Now, just several months into his presidency, Obama and his team had to determine if this nuclear bomb report was real or a hoax without invoking a state of panic.

Obama knew he had no choice but to act quickly. He dispatched his senior officials to approach Pakistan on the issue, but they initially dismissed the report. Knowing he couldn’t afford to take any chances, Obama ordered his nuclear detection and disablement team to travel to the region in case it needed to be searched. Ultimately, Pakistani officials responded and said they conducted a search that decisively concluded nothing was missing from their arsenal. But peering into the nuclear abyss so early in Obama's presidency, one official said, created "a lasting impression on all of us."

In addition to the threat of a dirty bomb, Sanger reports that the White House struggled to determine the extent to which the U.S military should engage in the Arab Spring. With U.S. military forces already bogged down in two wars, both in Islamic nations, the president struggled to weigh the costs and benefits of getting involved in Egypt and Libya. At times, Obama would lose his temper over the lack of options at his disposal.

Sanger’s book also reveals that during one of their initial phone calls after the conflict in Egypt unfolded, Egyptian President Hosni Mubarak told Obama to give him "ten days" to put the opposition to rest. Mubarak was certain that Obama, a first-term president, wouldn’t actually press him to step down. But Obama was less concerned with placating Mubarak and more about the larger message it would send to other allies about the country’s loyalty if he turned on the Egyptian leader.

One week into the protests, Obama burst into the Situation Room unannounced during a meeting of the NSC, seeking more aggressive action on Egypt. During the meeting, Mubarak gave a five-minute speech announcing he would not seek another term but making no mention of any plans to leave. Obama told his team the speech was insufficient. "Look, this is what I'm going to do," said the president. "I'm going to call [Mubarak] now and then I'm going to go out and make a statement saying there needs to be a transition." As his team scrambled to start putting together notes, Obama ended the discussion. "I don't even need that many talking points for that call."

It was, however, the Libyan revolution in 2011 that would truly divide the administration over whether the U.S. could and should take military action in another Islamic nation. What began as protests to oust an incumbent government, in the same vein as those in Tunisia and Egypt, quickly escalated into unprecedented violence. Obama's foreign policy team was split down the middle over what role, if any, the U.S. should take, with some advisers urging caution and others invoking comparisons to the Rwandan genocide. The final call came down to the president, who lost his cool during a meeting of the NSC on the afternoon of March 15.

The Libyan military was mere hours away from launching an assault that could cause the massacre of thousands, and Obama’s team presented him with two options: do nothing or enforce a no-fly zone. Obama turned to Adm. Mike Mullen, then chairman of the Joint Chiefs of Staffs, and asked him if a no-fly zone would put a stop to what they had just heard. Mullen shook his head. "No sir." The president snapped. "Well, then what are we even discussing here? Why are we having this meeting?” he asked. "If you're telling me that this guy is tearing through his country, about to overrun this city of seven hundred thousand people, and potentially kill thousands of people -- why is the option I'm looking at one that will do nothing to stop that scenario?" The room was silent. "This meeting is not worth having," an irritated Obama told his team. "I'm going to go to dinner with the Combatant Commanders and by the time I come back, I want some real options."

Also on HuffPost: