Perry declined to run for re-election to a fourth term as Governor and left office in 2015, launching a second presidential campaign shortly after. Perry's second presidential campaign failed to garner substantial polling support, fundraising or media attention, leading to him withdrawing from the race after only three months. Perry was initially a vocal opponent of Donald Trump's 2016 campaign for President, however he later endorsed Trump after he secured the Republican nomination. After winning the presidency, Trump appointed Perry as Secretary of Energy and he was confirmed by the United States Senate in a 62–37 vote on March 2, 2017. On October 17, 2019, Perry reported to Trump that he intended to resign as Secretary of Energy at the end of the year. He left office on December 1, 2019.