KABUL, Afghanistan - The top commander in Afghanistan said Tuesday that U.S. forces would begin a major shift next year to an advisory role, in hopes of building up the Afghan army's fighting skills and gradually extricating American and allied units from a combat role.

Gen. John Allen said small teams of U.S. advisers would be sent to Afghanistan to live and fight with Afghan army units starting in 2012, in hopes that large U.S. combat units can gradually step back from the lead role in providing security and withdraw completely by the end of 2014.

But the United States could face difficulty in reducing its combat role on such a rapid timetable. Afghan units remain plagued by personnel and operational problems, and large areas of the country still face stubborn insurgency. Allen acknowledged that U.S. and Afghan forces would have to step up offensive operations next year in eastern Afghanistan, which has remained an insurgent stronghold even as security has improved in the south.

White House officials support a shift toward an advisory effort because it will be a visible sign that the United States is disengaging from the decade-old war at a time when President Obama is running for reelection in part on his success at wrapping up wars in Iraq and Afghanistan.

Allen's comments Tuesday were the first time he publicly described his timetable for launching the advisory effort. The move is also aimed at shoring up backing for the continuing efforts in Afghanistan among other NATO members.

Allen and his staff would help Afghan forces operate independently by assigning them U.S. personnel to provide day-to-day advice on planning operations, as well as calling in artillery, close air support, and, if necessary, U.S. helicopters to evacuate wounded.

Allen made his comments on the day that Defense Secretary Leon E. Panetta arrived in Afghanistan for talks with commanders and Afghan officials. Panetta is on a weeklong trip to multiple war zones and will go to Iraq later this week for a ceremony marking the end of the U.S. military mission there.

The United States is still trying to repair relations with Pakistan after a U.S. helicopter attack on a Pakistan border post in late November killed two dozen Pakistani troops. Pakistan has closed border crossings through which NATO ships about 30 percent of its supplies, forcing the United States to rely more heavily on northern supply routes through Russia.

Allen said he had spoken with Gen. Ashfaq Kayani by phone Monday but declined to speculate on when the border crossings might be reopened.

There are 94,000 U.S. troops in Afghanistan, a number that is scheduled to drop to 91,000 by the end of December and to 68,000 by the end of next summer.