WASHINGTON — Defense Secretary Donald Rumsfeld stepped down as defense secretary on Wednesday, one day after midterm elections in which opposition to the war in Iraq contributed to heavy Republican losses.

President Bush nominated Robert Gates, a former CIA director, to replace Rumsfeld at the Pentagon.

Asked whether his announcement signaled a new direction in the war that has claimed the lives of more than 2,800 U.S. troops, Bush said, “Well, there’s certainly going to be new leadership at the Pentagon.”

Bush lavished praise on Rumsfeld, who has spent six stormy years at his post. The president disclosed he met with Gates last Sunday, two days before the elections in which Democrats swept control of the House and possibly the Senate.

Military officials and politicians dissatisfied with the course of the war had called for Rumsfeld’s resignation in the months leading up to the election. Last week, as Bush campaigned to save the Republican majority, he declared that Rumsfeld would remain at the Pentagon through the end of his term.

Source: Cheney stuck by RumsfeldBut a source told NBC News’ military analyst Bill Arkin that prior to the election, Vice President Dick Cheney argued with other politicians over whether Rumsfeld should stay. White House Chief of Staff Josh Bolten and others said Rumsfeld should be removed, the source said. Both sides agreed the decision would be made after the election, when Bush would make the final call based on how Republicans did.

According to the source, Bush agreed Rumsfeld should be removed after seeing election results favoring Democrats. Cheney then lost another argument, protesting Gates’ nomination as Rumsfeld’s replacement.

Rumsfeld, 74, was in his second tour of duty as defense chief. He first held the job a generation ago, when he was appointed by President Ford.

Whatever confidence Bush retained in Rumsfeld, the Cabinet officer’s support in Congress had eroded significantly. Rep. Nancy Pelosi, D-Calif., the House speaker-in-waiting, said at her first postelection news conference that Bush should replace the top civilian leadership at the Pentagon.

And Senate Majority Leader Bill Frist, who had intervened in the past to shore up support for Rumsfeld, issued a statement saying, “Washington must now work together in a bipartisan way — Republicans and Democrats — to outline the path to success in Iraq.”

The Pentagon offered no date for Rumsfeld’s departure.

Appointee a close Bush family friendGates, 63, has served as the president of Texas A&M University since August 2002, and as the university’s interim dean of the George Bush School of Government and Public Service from 1999 to 2001.

Texas A & M via Getty Images file

Former CIA Director Robert M. Gates

The school is home to the presidential library of Bush’s father. Gates is a close friend of the Bush family, and particularly the first President Bush.

He served as deputy national security adviser from 1989 to 1991 and then as CIA director during the first Iraq war, from 1991 until 1993.

Gates joined the CIA in 1966 and is the only agency employee to rise from an entry level job to the seventh-floor director’s office. He served in the intelligence community for more than a quarter century, under six presidents.

Bush has considered Gates for jobs before, including in 2005 when he was searching for a candidate to be the nation’s first national intelligence director.

His nomination must be confirmed by the Senate.

Rep. Ike Skelton, D-Mo., who is expected to chair the House Armed Services Committee next year, said Rumsfeld’s resignation “presents an important opportunity for our country to begin a new policy direction in Iraq and in the war on terrorism.”

He encouraged the Bush administration to take advantage of the fresh start.