In a 100-0 vote, the Senate backs the former CIA director, who will replace Robert M. Gates. The vote comes as President Obama prepares to announce a plan for reducing troops in Afghanistan.

Leon Panetta, former CIA director, was confirmed by the Senate as secretary… (Olivier Douliery, Abaca…)

Reporting from Washington — The Senate unanimously confirmed Leon E. Panetta as secretary of Defense on Tuesday, putting the Pentagon in the hands of a former Democratic congressman and budget expert amid growing political discontent over the cost and reach of President Obama's military engagements.

Panetta, who spent two years as director of the Central Intelligence Agency, will replace Robert M. Gates, who is retiring after serving in two consecutive administrations.

In a statement, Panetta thanked the Senate "for the strong vote of confidence" and said he was "deeply honored" by the 100-0 tally and the president's nomination.

His confirmation comes as Obama is poised to reveal his plan to reduce troop levels in Afghanistan, and as Congress is expressing frustration over the administration's stance on the U.S. military's role in Libya.

While heaping praise on Panetta before the vote, some senators questioned the administration's Afghanistan policy, underscoring the challenge facing the new Defense chief. More than two dozen senators sent Obama a letter urging a significant drawdown of troops.

In a Wednesday night speech from the White House, Obama is expected to spell out a plan to withdraw about 10,000 troops from Afghanistan this year, according to a senior administration official. He was also considering a withdrawal of about 30,000 troops by the end of 2012.

Under Panetta, the CIA has been more skeptical than the U.S. military about the success and sustainability of the current counter-insurgency strategy in the 10-year war.

Panetta, 72, chaired the House budget committee while a California congressman. He became director of the Office of Management and Budget under President Clinton, whom he also served as chief of staff.

Obama is likely to ask Panetta to find significant savings in the Defense budget. But Panetta was not specific about numbers or programs during his confirmation hearing.

Some observers wonder whether Panetta will become less enamored of Defense cuts once he takes the helm of the Pentagon.

He came into the CIA deeply skeptical about some things the agency did under President George W. Bush, including interrogations that Panetta flatly called torture. But once Panetta occupied the director's office at Langley, Va., he opposed a move by Atty. Gen. Eric H. Holder Jr. to reopen a criminal investigation into CIA interrogators' actions. Panetta became extremely popular among the agency's rank and file.

He presided over a vast expansion of the CIA's drone strike program in Pakistan, and oversaw the operation that found and killed Osama bin Laden.

Panetta technically was the commander of the U.S. special operations raid of the Bin Laden compound, because it was a covert operation run by the CIA. But he delegated operational control to Adm. William H. McRaven, a Navy SEAL who heads the Joint Special Operations Command.

A former Army lieutenant who entered politics as a Republican, Panetta became a Democrat in 1971 and served nine terms in Congress.