Caterpillar and Boeing also advanced to trade among the top five contributors to gains in the Dow Jones industrial average. The index climbed 15 points following Trump's budget briefing at the White House.
Trump said increases to the budget in defense spending will be offset by savings elsewhere, and his administration will be "moving quickly" on the reform.
The energy sector led advancers in the S&P 500, while the materials sector briefly rose about half a percent following Trump's comments.
The S&P 500 and the Dow are both up more than 5 percent for the year so far.