WASHINGTON — When it was first announced last spring, President Trump’s proposal for a new Space Force was resisted by the Pentagon and ridiculed by late-night comics who envisioned Luke Skywalker in the military. But it found a champion in Patrick M. Shanahan, the deputy secretary of defense who will soon become the Pentagon’s acting chief.

“We are not the Department of No,” Mr. Shanahan told Pentagon officials after Space Force was announced, arguing that it was a presidential priority and could help develop new military capabilities more quickly. “There is a vision, and it makes sense.”

Now, Mr. Shanahan, a former Boeing executive, has been thrust into the Pentagon’s top job at one of the department’s most tumultuous times in years. Defense Secretary Jim Mattis, who during his tenure pushed back on a number of White House requests, resigned last week in the wake of Mr. Trump’s decision to withdraw troops from Syria.

Mr. Mattis originally said he would step down at the end of February. But angered by the criticism in Mr. Mattis’s resignation letter, Mr. Trump announced over the weekend that he was shoving Mr. Mattis out early and elevating Mr. Shanahan — at least temporarily. One of Mr. Mattis’s final acts was to sign the order beginning the withdrawal of American troops from Syria, a Defense Department official said on Monday.