Washington (CNN) -- President Barack Obama on Thursday shuffled familiar faces in his national security team to deal with the pending retirement of Defense Secretary Robert Gates, reflecting a desire for continuity and the changing nature of modern warfare.
Obama named Central Intelligence Agency Director Leon Panetta as his nominee to succeed Gates, with Gen. David Petraeus chosen to succeed Panetta at the CIA.
In addition, Lt. Gen. John Allen would succeed Petraeus as head of the U.S-led international military force in Afghanistan, and longtime diplomat Ryan Crocker will be nominated as the next U.S. ambassador to Afghanistan, the president announced at the White House.
It is the biggest shakeup of his security team since Obama took office in January 2009, affecting virtually every national security issue including counter-terrorism efforts, the war in Afghanistan, relations with Pakistan, Pentagon spending and the continuing increase of joint CIA-military operations.
"Given the pivotal period that we're entering, I felt that it was absolutely critical that we had this team in place, so that we can stay focused on our missions, maintain our momentum and keep our nation secure," Obama said in urging the U.S. Senate to quickly confirm the four nominations. He later added: "I cannot think of a group of individuals better-suited to lead our national security team at this difficult time."
The president also thanked Gates -- the only Cabinet holdover from the Bush administration -- for staying on as defense secretary despite having long planned for retirement. He joked that Gates had "carried a clock that counted down the days, hours and minutes" before Obama asked him to continue his service.
Gates, who made clear last year he would step down in 2011, returned the joke by thanking the president "for inviting me to stay on, and on, and on."
His voice catching, Gates said his highest priority has been to help the military men and women who put themselves "in harm's way" on behalf of national security, adding: "I've done my best to care for them as though they were my own sons and daughters, and I'll miss them deeply."
More changes are coming. Both Adm. Mike Mullen, chairman of the Joint Chiefs of Staff, and FBI Director Robert Mueller are not eligible for renomination for terms that expire this year.
For now, Obama's choices showed that he intends for a continuation of the current policy direction in Iraq and Afghanistan, as well as efforts to cut military spending while modernizing the armed forces.
"We cannot compromise our ability to defend our nation or our interests around the world," Obama said.
Gates will resign effective June 30, assuming Panetta gets confirmed by Congress in time and is ready to start on July 1. Petraeus will remain in command in Afghanistan until Allen is ready to take over at the beginning of September, and Panetta said in a statement to CIA personnel that Michael Morell would serve as acting director in the interim.
In addition, Petraeus will resign from the military once confirmed so that he serves as a civilian CIA director, Obama said.
Initial reaction from Congress was positive, with key legislators on intelligence and security issues praising both Panetta and Petraeus as good choices.
"The sum total of these picks is that the president has chosen experienced people with unique capabilities to serve our nation at a dangerous time," said Republican Sen. Lindsey Graham of South Carolina. "This team will provide the leadership to help make our nation safer. I could not be more pleased with these selections. I hope these nominees receive swift approval by the United States Senate."
Gates told legislators and staff members that he recommended Panetta for his job six months ago, and joked that Panetta stopped speaking to him for days for doing so, officials said. In addition, Gates said that Allen was a consensus choice to succeed Petraeus.
It took a meeting with Obama to convince Panetta to accept the job, a source familiar with the discussions told CNN. Panetta has been happy serving at the CIA, but "believes strongly in public service and answering the call from the commander-in-chief," the source said.
Panetta, 72, took over at the CIA in February 2009. He served as chief of staff to President Bill Clinton between 1994 and 1997, and was previously the director of the Office of Management and Budget (OMB). The California Democrat served in the House of Representatives from 1977 to 1993.
Before coming to the CIA, he spent 10 years co-directing a public policy institute with his wife, Sylvia.
He was brought in as a relative outsider, without hands-on intelligence experience, to manage an agency that had been shaken by the exposure and criticism of its controversial interrogation and detention program. Panetta's longstanding ties to Congress were seen as a way to restore the administration's relationship with oversight committees. He has been given high marks on both fronts from inside the agency and in Congress.
Panetta "may be the most skilled person in government," said Democratic Sen. Dianne Feinstein of California, who chairs the Senate Intelligence Committee. "He came to the CIA at a turbulent time, after a lot of criticism over detention, interrogation and the failure to adequately brief Congress. He has restored order and morale at the agency and shown himself to be able to handle anything that comes at him."
Now, she said, "I can't think of a more capable person to take on the challenge of being Secretary of Defense at a time of war, unrest and conflict in the Middle East, an over-stretched military, and the need to rein in Pentagon spending."
John McLaughlin, a former CIA deputy director, said Panetta's time at the CIA handling tough decisions will serve him well as defense secretary.
"He'll deal with it the way he dealt with issues at the CIA. He'll seek the facts," McLaughlin told CNN. "Panetta's just been through a couple of years where he has had to make difficult decisions on which there were no easy answers. That's pretty good schooling for the kinds of decisions he is going to have to make at the Pentagon, where budget cuts are obviously going to be necessary and difficult choices are going to be necessary."
McLaughlin also noted that both Panetta and Petraeus, who have been involved in reviewing Afghanistan policy under Obama, would continue to play major roles "in different chairs."
"I don't see this bringing major changes in Afghanistan policy," he said.
David Berteau, a senior adviser at the Center for Strategic and International Studies, said Panetta "learned a lot of lessons" about defense budgeting during his stint as the head of the OMB, and knows how to deal with a Republican Congress, as he did during the Clinton administration.
Petraeus assumed command of the NATO International Security Assistance Force (ISAF) and U.S. Forces Afghanistan on July 4, 2010, after serving for more than 20 months as commander of United States Central Command. He previously commanded multi-national forces in Iraq, leading the so-called "surge."
The 58-year-old four-star general represents a new breed of military leader well-versed in counter-insurgency strategies that depend on coordination and cooperation with the CIA.
"He has a unique understanding of the important role of the CIA -- what they do, how they do it," said Frances Townsend, CNN's security analyst who was a homeland security adviser to President George W. Bush. "I think he's got both a good understanding of how they work and their value to the military mission."
Petraeus also was considered a credible candidate to succeed Mullen as chairman of the Joint Chiefs of Staff. As the architect and leader of the surge in Iraq and now head of the Afghanistan mission, Petraeus is considered the nation's most well-known and popular military leader since Colin Powell.
Sources told CNN that Petraeus, whose current tour in Afghanistan is winding up with the expected start of a troop drawdown later this year, never really wanted to be Joint Chiefs chairman. Instead, Petraeus wanted to be in a "command" rather than the joint chief chairman's advisory role to the president, the sources said.
Some conservatives complained that moving Petraeus to the CIA would deny the nation his leadership in a key role as the nation's top military officer.
"It seems clear that the administration's number one desire was to deny one of the greatest generals of the last century the chairmanship of the Joint Chiefs," said Danielle Pletka, vice president for foreign and defense policy studies at the American Enterprise Institute.
Townsend called a move to the CIA for Petraeus "surprising," given his military command experience. "Is it the obvious next step in his illustrious career? No," she said, adding: "But he'll do very well at it."
Bruce Riedel, a former CIA officer now at the Brookings Institution's Saban Center for Middle East Policy, said Petraeus knows the Washington decision-making process and probably never would have agreed to the move without a guarantee of access to Obama.
"Any appointment in every administration has political angles to it," Riedel said. "The David Petraeus I know is not a shrinking violet. If he thinks a decision is a wrong, decision, he'll have ways of making that clear."
While Petraeus enjoys widespread popularity in Congress, Feinstein indicated he could face tough questioning from her panel.
"He is clearly a very accomplished officer and familiar with the parts of the world where many of the threats to our security originate," Feinstein said, noting that Petraeus has commanded intelligence resources in Iraq and Afghanistan. "But that is a different role than leading the top civilian intelligence agency. I look forward to hearing his vision for the CIA and his plans to make sure the CIA is collecting the type of intelligence that policymakers need."
Crocker has served previously as U.S. ambassador to Iraq and to Pakistan, while Allen became deputy commander of U.S. Central Command in July 2008.
Gates, who replaced Donald Rumsfeld as defense secretary in December 2006, did not expect to stay on after Bush's presidency ended. However, he agreed to join Obama's Cabinet when the president-elect expressed a desire for continuity at the Pentagon, given the ongoing conflicts abroad in Iraq and Afghanistan.
It is unclear who may replace Mueller at the FBI.
Attorney General Eric Holder on Tuesday did not rule out Mueller staying on short-term when his 10-year term expires in September if a successor has not yet been confirmed.
CNN's Barbara Starr, Joe Sterling, Terry Frieden, Alan Silverleib, John King and Chris Lawrence contributed to this report.