Michael T. Flynn resigned as national security adviser on Monday night following the revelation that he had misled White House officials about conversations he had with the Russian ambassador to the United States. President-elect Donald Trump offered Flynn the post of national security adviser, elevating the retired general and intelligence officer who saw Islamist militancy as a global existential threat.