(Updates after handover ceremony)
By David Alexander
KABUL, Feb 10 (Reuters) - The U.S. Marine Corps general who will oversee the withdrawal of most foreign troops from Afghanistan and wind down America's longest war took command of NATO-led forces on Sunday at a change-of-command ceremony that emphasized Afghan sovereignty.
General Joseph Dunford took charge of the International Security Assistance Force from Marine Corps General John Allen, who ended a 19-month tour that was arguably one of the most difficult periods in the war, now in its 11th year.
"Today is not about change, it's about continuity. What has not changed is the will of this coalition ... What has not changed is the inevitability of our success," Dunford told a crowd of foreign and Afghan officials in an aging gymnasium at the barricaded ISAF headquarters.
Senior military officials, including Dunford and Allen, sat on a dais covered with an Afghan rug as a band played the U.S. and Afghan national anthems and a color guard presented the flags. Several hundred guests were seated in chairs on the floor of the old basketball court.
Afghan President Hamid Karzai was absent from the ceremony despite receiving an invitation from ISAF. A spokesman for Karzai declined to comment. General Martin Dempsey, the highest-ranking U.S. military officer, said later he thought the level of Afghan representation at the ceremony was appropriate.
Allen, who directed ISAF's transfer of most security across the country to the Afghan army and police, gave an emotional speech stressing the nation's sovereignty, an issue that has been a thorn in Karzai's relationship with his Western backers.
Located between Iran, Pakistan and Central Asia, Afghanistan has been subject to invasions since the ancient Greeks, through to the 19th-century "Great Game" - the scramble for power between Britain and Russia - and the last three decades of conflict.
Citing international support for a transformative decade in Afghanistan, Allen said: "I believe that in 10 years, Afghanistan will never again be a place between empires, caught in the grindstone of international politics."
AFGHANS TAKE THE LEAD
Dunford assumes control of ISAF at a time when the 350,000-strong Afghan military and police forces have taken over the lead role for security across most of the country, and are due to be fully in the lead everywhere within a few months. ISAF's primary role will be to assist, advise and train Afghan forces.
Allen and Dempsey, the chairman of the U.S. Joint Chiefs of Staff, said the challenge for Dunford through the end of 2014 would be to balance the withdrawal of international forces with the continuing need to assist and train Afghan troops, all while pressuring al Qaeda.
"Closing bases, moving equipment - if you're not careful, that can become the mission," Dempsey said. "So he's got to keep all those things in equilibrium."
Allen said the Afghan army and police were becoming ever more capable.
"Afghan forces defending Afghan people and enabling the government of this country to serve its citizens. This is victory. This is what winning looks like," Allen said.
Officials said that, while the insurgency remains a challenge, dealing with government corruption increasingly poses the biggest threat to Afghanistan's long-term viability.
"The strategic long-term enduring threat, it's not the insurgency. It is the degree of corruption and criminality that exists within the government," a senior ISAF official said on condition of anonymity. "If you can deal (with that) ... then you can start ... pulling the carpet out from underneath the insurgency."
Allen told reporters he thought Karzai had put in place the mechanisms to deal with corruption, but added: "We've reached a point now where rhetoric, while it was encouraging, isn't enough any more ...
"The rhetoric has to be accompanied by real and meaningful reform, reform that reduces the capacity of the criminal patronage networks to grip and weaken institutions of state."
Allen also said education was helping to turn the tide of public opinion in Afghanistan against Taliban insurgents, who banned girls from most schools. He earlier told Reuters that advancing women's rights was key to preventing the Islamist group regaining support.
The White House said last month it would nominate Allen as NATO's supreme allied commander in Europe, after the Pentagon cleared him of professional misconduct over emails to a Florida socialite linked to a scandal that led his predecessor, David Petraeus, to resign as director of the CIA. (Writing by Amie Ferris-Rotman; Editing by Kevin Liffey)