Although US commanders had already indicated a move towards an advisory mission in coming months, Panetta's comments marked the first time the US administration had forecast American and allied troops could end their combat operations by the second half of next year.
"Hopefully by the mid-to-latter part of 2013, we'll be able to make a transition from a combat role to a train, advise and assist role," Panetta told reporters aboard his plane en route to a NATO meeting in Brussels.
With President Barack Obama facing a tough re-election campaign, the Pentagon's chief's remarks represented the strongest signal yet that the White House wants to wrap up the wars it inherited from the previous administration, after having overseen the withdrawal of American forces from Iraq in December.
Obama took a similar approach in Iraq before the pullout there, declaring an end to the combat mission while the Pentagon renamed units as "advise and assist" brigades.
Panetta portrayed the approach as in keeping with a gradual NATO plan adopted in Lisbon in November 2010, which calls for handing over security duties to Afghan forces by the end of 2014.
Washington has vowed to withdraw combat forces battling the Taliban by the end of 2014 but has left the door open to a follow-on force likely focused on training, depending on the outcome of negotiations with the Afghan government.
Panetta said Washington wanted to see all the NATO allies in Afghanistan -- including France -- "respect" the NATO timeline.
"We all went in here together and we'll all go out together, but we have to do it on the basis of a strong alliance and a strong commitment that was made in Lisbon," said Panetta, who was due to meet NATO defense ministers on Thursday.
The NATO-led coalition this year needed to cement battlefield gains against the Taliban insurgency and to build on progress in strengthening the Afghan army and police, he said.
He said 2013 would be a "crucial" year for the final transfer of remaining areas to Afghan security forces.
"2014 becomes a year of consolidating the transition," he said.
It was unclear how the planned shift from combat to a mainly advisory role would affect planned troop levels for US forces.
With nearly 90,000 US troops now in Afghanistan, Panetta said that "no decision has been made with regards to the level of forces we'll have in 2013."
By the end of September, the number of US troops is due to drop to 68,000, following the scheduled withdrawal of a "surge force" that deployed in 2010.
The Pentagon chief sought to play down the effect of last month's surprise announcement from French President Nicolas Sarkozy to withdraw French combat forces in 2013, a year earlier than planned under the NATO strategy.
"With regards to France, I understand why they made their decision," Panetta said.
Despite the French withdrawal plans, he said he was "pleased" that France had indicated it would retain a longer-term military presence with troops training and advising Afghan forces.
A senior US defense official told reporters it was possible that there was no serious gap between the French stance and NATO's timeline, depending on the precise details of what Paris planned.
"I think the discussions will reveal whether there's a serious difference or not," said the official, who spoke on condition of anonymity.
"What we need to discuss with the French is exactly what role they envisage playing in 2013 and 2014, whether there's a serious difference in terms of the milestones that they envisage," the official said.