WASHINGTON — One of Robert Gates’ final tasks before retiring as defense secretary is to set the Pentagon on a budget-cutting course he had spent much of his 4 1/2-year tenure trying to avoid — a path that could shrink the military’s role in the world.

He is taking that road, despite his worry about eroding military strength, because President Barack Obama in April ordered up another $400 billion in defense savings over the coming 12 years. No details have been decided yet, but Gates has said savings on that scale are not possible without slicing military power.

The Pentagon chief is expected to elaborate on his approach in a speech at a think tank Tuesday. His staff has billed it as his final policy speech in Washington before he retires on June 30.

Gates is leaving to his designated successor, Leon Panetta, the tough task of meeting White House and congressional demands for new budget savings while the nation is still at war. But before he goes, Gates wants to ensure that decisions are based on a broad review of future military needs.

“If the political leadership of this country decides that it must reduce the investment in defense by hundreds of billions of dollars, then I don’t think we can afford to have anything that’s off the table,” Gates told reporters last week when asked whether the review would consider eliminating part of the U.S. nuclear arsenal.

Gates has said that all three “legs” of the U.S. strategy nuclear force — bombers, land-based missiles and nuclear-armed submarines — are due for expensive modernization.

“You may have to make some choices there,” he said April 21, implying that one leg might have to be dropped.

That is the kind of choice that Gates previously had said need not be made. In warning last August against “steep and unwise” reductions in defense spending, Gates argued that he already had cut as much as was advisable.

“The current and planned defense budgets, which project modest but steady growth, represent the minimum level of spending necessary to sustain a military at war and to protect our interests and future capabilities in a dangerous and unstable world,” he said then.

Thomas Donnelly, a defense specialist at the American Enterprise Institute, said it’s clear to him that Gates believes his budget-cutting orders from Obama could upset the strategic course that Gates had set previously. Donnelly said Gates had been “bushwhacked” by the White House — informed of the president’s $400 billion reduction target just one day before he announced it April 13.

Some in Congress are pushing to cut defense even more deeply as part of a broader effort to shrink the government’s deepening budget deficits; the shortfall in the current budget year alone is expected to reach $1.5 trillion.

That political momentum is reinforced by a perception that the wars in Iraq and Afghanistan are coming to an end, and that the killing of Osama bin Laden means the war on terror is winding down. Gates, however, is quick to point out that Afghanistan remains unstable and military crises tend to erupt without long lead times.

“Since Vietnam, we have had a perfect record in predicting where and when we would use military force. We have never once gotten it right,” he told a group of Marines at Camp Lejeune, N.C., two weeks ago. “If you’d asked me four months ago if we’d be in Libya today, I would have asked you what you were smoking.”

More worrisome are potential future conflicts in Iran or Korea or setbacks in Afghanistan, Pakistan or Iraq.

The central question in the budget debate, Gates says, is what pieces of military might is the country willing to give up?

What among the many things the military is doing today in all corners of the world should it stop doing?

What can be curtailed or eliminated, and at what risk to U.S. security?

Gates says he won’t take an across-the-board approach — spreading the budget-cutting pain evenly among the Army, Navy, Air Force and Marine Corps, for example. He calls that “managerial cowardice.” Instead, he wants to compel the White House and the Congress to decide what kind of military the country needs in the years ahead, then make budget-cutting decisions to fit that vision.

Loren B. Thompson, a defense analyst and consultant, said he believes Gates is using the $400 billion marker as an opportunity to make a final statement, before he retires, about the dangers of weakening defense.

“You can’t take the plan too seriously,” Thompson said, since most of the projected savings would likely come toward the end of the 12-year period announced by Obama — long after both he and Gates are out of office.

Gates in recent days has offered clues to what he thinks might be the outcome of the strategy and budget review he has set in motion. He has identified four main areas in which further defense spending cuts could made.

The first is what Gates calls “efficiencies,” cutting overhead costs. Last year he identified $178 billion worth of savings in that area. He thinks more such savings can be found by, for example, consolidating military headquarters.

The second is what he calls “marginal missions” — stop doing things that are useful but not essential.

The third is the politically sensitive area of personnel costs, including military pay, health care and retirement benefits. “Those are all tough” to restrain, he said earlier this month, because of reluctance in Congress.

And the fourth is a revamping of basic defense strategy, possibly dropping the requirement of being able to fight two wars simultaneously. That could allow a cut in the required number of Army and Marine combat brigades or fighter aircraft units, he told soldiers at Fort Leonard Wood, Mo., last week. But it also would carry risk in the unlikely event of war in Korea.

“Who’s to say that the Iranians don’t say, ‘What a great opportunity — the Americans are busy over there. Let’s take advantage of the situation,’” Gates said.