All 100 members of the Senate approved the nomination of Panetta, who turns 73 next week, hailing his service as the head of the Central Intelligence Agency during which the United States tracked down and killed Osama bin Laden.
In a break with Gates, Panetta has said he supported the withdrawal of a significant number of troops from Afghanistan next month.
Obama is due to announce Wednesday his plans to withdraw troops from Afghanistan as the military works to put Afghans in charge of their own security by 2014 and wrap up what is now an almost decade-long war.
The president has said the withdrawal of troops will begin in July, but that the timetable would be determined by conditions on the ground.
Panetta is on track to replace Gates July 1 and be succeeded as CIA chief by General David Petraeus, now the US commander in Afghanistan.
Recent months have seen mounting US opposition to the war in Afghanistan, where the United States has deployed some 100,000 troops nearly 10 years after invading the country to capture or kill al Qaeda chief Bin Laden.
Support for withdrawing US forces has spiked since US commandos killed bin Laden in his Pakistan hideout last month.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ