U.S. Defence Secretary Leon Panetta arrived in Kabul on Tuesday for an unannounced visit at a time of persistent violence and as the United States and its Western allies are reducing troop levels in Afghanistan.

Panetta's visit comes on the heels of bomb attacks on Shi'ite Muslim ceremonies in three Afghan cities. Afghan President Hamid Karzai said the attacks killed 80 people.

NATO commanders say that a surge of more than 30,000 U.S. troops in 2009-2010 helped push the Taliban out of some areas of its southern heartland.

But the United Nations and other groups say violence nationwide is at its worst since U.S.-backed Afghan forces toppled the Taliban from power in late 2001.

Afghanistan's future remains unclear as the government and its Western allies race to train and expand the national police and army while foreign troops start heading home.

The Obama administration plans to withdraw its surge troops by the end of next fall, leaving about 68,000 American soldiers.

Most foreign combat troops are expected to leave by the end of 2014, when the Afghan government is due to have complete control of security across the country.

The gradual transition to Afghan control began this summer, and a second phase announced late last month will mean more than half the population is living in areas where security has been handed over officially.

(Reporting by Missy Ryan; Editing by Paul Tait)