Mr. Shanahan insisted on Friday that the budget transfer would not affect “readiness,” the military catchall term that refers to the ability of American troops to fight when called up. But some of the funds — officials say $600 million — “did come from money we were under-running or saving or whatever, you know, terminology you want to use, from Afghanistan,” he said.

The Pentagon notified Congress of the funding switch on Friday, one day after White House officials said that Mr. Trump would nominate Mr. Shanahan to formally fill the job left vacant when Jim Mattis resigned as defense secretary in December.

The twinning of the moves is bound to affect what was already going to be a challenging confirmation battle for Mr. Shanahan. In a letter to the acting defense secretary on Friday, several Democratic senators sharply criticized the diversion of funds from the Afghan war effort.