Bob Gates left the Pentagon in early July, but the new national-security team that is taking over this summer is largely Gates' creation -- reflecting the unusual influence of a Republican defense secretary in shaping the Obama administration's personnel and policies.

Gates' recommendations have been tapped for most of the top positions at the Pentagon. Just as important, the candidates Gates decided wouldn't be good team members have fallen by the wayside, even if they had initial White House support.

Leon Panetta, the new defense secretary, will lead a team that is collegial and congenial, two qualities Gates prized. The question is whether they have the toughness to say no to Pentagon bureaucracies that excel at logrolling and political horse-trading. Gates' secret was his ability to impose accountability, and, with his barbed wisecracks, to scare subordinates into following his orders. This skill will be hard to replicate.

Gates decided last year that Panetta would be the right successor. As CIA director, Panetta had taken part in every major decision since early 2009, so there wouldn't be a steep learning curve. Moreover, Gates was impressed by how strongly Panetta had fought to protect CIA personnel.

Another big plus was Panetta's expertise in budget matters, as a former director of the Office of Management and Budget. Where Gates was brought to the Pentagon in 2006 to "fix Iraq," Panetta's top priority will be "fixing" the military budget.

Gates managed to find a balance between supporting the troops and holding senior officers accountable. This will be a challenge for Panetta, whose initial reaction to the December 2009 suicide bombing of a CIA base in Khost, Afghanistan, was to fend off well-deserved criticism.

Where Gates could be clipped and abrupt, Panetta is loose and garrulous. And he likes briefings: He has a daily "morning meeting" with a dozen senior aides, and an "operations group" meeting three times a week to discuss sensitive operations. Both are departures from Gates, who liked to devour written reports.

The Gates imprint is clear in the selection of Gen. Martin Dempsey to replace Adm. Mike Mullen as chairman of the Joint Chiefs. For many months, it appeared that Cartwright, a brainy Marine, had a lock on the job. President Obama and his senior staff were spellbound by Cartwright's explanations of complex defense technology.

Cartwright's problem, according to several top officials, was that he developed a reputation as a "lone wolf" who sometimes didn't collaborate well with colleagues. Much has been made of his 2009 support for a limited counterterrorism option in Afghanistan, contrary to the views of Gates and Mullen. But the problem went deeper: Cartwright had a prickly relationship with Mullen, and other chiefs questioned if he would be a reliable conduit for their views.

What finally undid Cartwright was that Gates concluded the critics were right -- and that the vice chairman had been providing advice to the White House without informing senior colleagues. That's when Dempsey emerged as Mullen's successor.

Cartwright's departure will leave a big hole. His successor as vice chairman, Adm. James Winnefeld, is a much-liked officer, but he lacks Cartwright's mastery of technology.

Gates was one of the most effective defense secretaries in modern times. He tried in his final months to hand over a Pentagon in his own image. But the X-factor was the quirky, irascible, deeply experienced Gates himself -- and they made only one of those.