On October 11, 2017, President Donald Trump nominated Nielsen to be the new United States Secretary of Homeland Security. On December 5, 2017, the Senate confirmed her nomination, by a 62-37 vote. She resigned on April 7, 2019.