President Obama nominated Army Gen. Martin E. Dempsey as chairman of the Joint Chiefs of Staff and promoted two other senior military leaders Monday, completing an overhaul of his national security team in advance of the 2012 election.

Obama’s appointments will usher in a new leadership at the Pentagon, where for the first 21 / 2 years of his term he had kept most of the existing brass from his predecessor George W. Bush.

Dempsey, who served two war tours as a commander in Iraq, was not believed to be Obama’s first choice. For more than a year, the president had been leaning toward Marine Gen. James E. Cartwright, the vice chairman of the Joint Chiefs, one of his most trusted military advisers. But Obama informed Cartwright on May 21 that he wouldn’t get the job because of opposition from Defense Secretary Robert M. Gates and the outgoing chairman, Adm. Mike Mullen, who butted heads with Cartwright over strategy for the war in Afghanistan.

Speaking at the White House before a Memorial Day visit to Arlington National Cemetery to lay a wreath in honor of the nation’s war dead, Obama did not explain why he bypassed Cartwright. He showered the general with praise, saying he has “benefited enormously from [his] advice and counsel.”

In turning to Dempsey, Obama had to pull him out of a high-ranking position — Army chief of staff — that he had appointed him to just last month. Obama called Dempsey “one of our nation’s most respected and combat-tested generals.”

To fill the vacancy of Army chief of staff, Obama said he would appoint Gen. Ray Odierno, a four-star former commander in Iraq who has served for the past year as head of the Joint Forces Command, based in Norfolk. The Pentagon is closing the command as part of a broader money-saving restructuring plan.

Obama also named Adm. James “Sandy” Winnefeld Jr., head of the military’s Northern Command, to take over as vice chairman of the Joint Chiefs.

All of the appointments are contingent upon Senate confirmation. If approved, Dempsey will take over Oct. 1 from Mullen, who is scheduled to retire four years after Bush named him to the job. Cartwright’s term as vice chairman will end in August.

Obama said Dempsey and Winnefeld would make “an extraordinary team” on the Joint Chiefs of Staff. “Between them they bring deep experience in virtually every domain,” he said. “Land, air, space, sea and cyber. Both of them have the respect of our troops on the front lines, our friends in Congress and allies and partners abroad.”

The chairman of the Joint Chiefs of Staff is the highest-ranking officer in the armed forces and the principal military adviser to the president.

Dempsey’s appointment comes one month after Obama nominated CIA Director Leon Panetta to move to the Pentagon to replace Gates as defense secretary. Gates, another Bush administration holdover, is scheduled to retire June 30.

Army Gen. David H. Petraeus, commander of U.S. and NATO forces in Afghanistan, is slated to succeed Panetta as CIA chief.

The new national security team is taking shape as Obama faces pivotal decisions in Afghanistan, where he has promised to begin withdrawing at least some troops in July amid waning public and congressional support for the conflict.

Obama’s war cabinet also must decide its role in quelling the violence in Libya, where a NATO-led campaign to protect civilians has lapsed into a drawn-out conflict with Libyan ruler Moammar Gaddafi. Yet more questions loom in Iraq, where the White House has an agreement with the Iraqi government to withdraw all U.S. forces by the end of the year. Some White House and Pentagon leaders would like to negotiate a new deal to allow at least some troops to remain longer.

At the same time, the new faces at the Pentagon will have to grapple with an expected freeze — or at least an abrupt slowdown — in the defense budget, which has roughly doubled over the past year to more than $550 billion, excluding the cost of the wars in Afghanistan and Iraq.

Dempsey commanded the Army’s 1st Armored Division during the height of the Iraqi insurgency, overseeing 20,000 soldiers based in Baghdad. He also spent two years in charge of the development of Iraqi army and police forces that were supposed to take over the battle against insurgents.

Odierno also served several years in Iraq, including as commander of all U.S. forces in the country from September 2008 to September 2010.

Obama will need to name another member of the Joint Chiefs of Staff in the coming weeks to replace Adm. Gary Roughead, the head of the Navy, who is scheduled to retire in September. The other chiefs are Gen. Norton A. Schwartz, the Air Force chief of staff, and Marine Corps Commandant Gen. James F. Amos.