Tony Abbott has announced an end to Australia's longest war during a surprise visit to Afghanistan, accompanied by Opposition Leader Bill Shorten.
Prime Minister Tony Abbott has declared a symbolic end to "Australia's longest war", even though about 400 troops will remain in Afghanistan next year and perhaps beyond.
Mr Abbott said the Afghanistan campaign had come at a high price with 40 dead, 260 wounded and many more carrying mental scars.
Accompanied by Opposition Leader Bill Shorten in the first ever bipartisan visit, Mr Abbott told troops at the main Australian base at Tarin Kowt they had done their duty and the future of Oruzgan Province was now in the hands of its people.
"Australia's longest war is ending, not with victory, not with defeat, but with we hope an Afghanistan that's better for our presence here," he said.
Mr Abbott said it was a bittersweet moment.
"Sweet because hundreds of soldiers will be home by Christmas, bitter because not all Australian families have had their sons, fathers and partners returned."
Mr Abbott said Afghanistan remained a dangerous place despite all that had been done.
But Oruzgan was now richer and better governed thanks to Australian and coalition efforts, there are many more schools and roads, and healthcare is widely available.
Australian special forces soldiers first deployed into Afghanistan in December 2001 but the Australian presence subsequently dwindled to just one soldier as attention turned to Iraq.
From 2005, the Australian presence again escalated to more than 1500, most based at Tarin Kowt.
Under current plans, all combat will end and all troops will withdraw from Oruzgan Province by the end of the year.
However, some 400 will remain in a variety of non-combat roles including mentoring of the Afghan National Army (ANA) 205 Corps headquarters in Kandahar and of instructors at the ANA Officer Academy in Kabul.
A small group of 18 special forces soldiers will remain in an advisory role in Kabul.
Afghanistan's interior minister Omar Daudzai praised the soon-to-depart Australian forces, declaring them the best of all coalition forces.
"They have always put the Afghan people first," he said.
Mr Shorten, in his first overseas trip as opposition leader, told the soldiers their service made Australians proud.
"I don't think saying thank you is quite enough but it's the words that we can find," he said.
"You can be assured that every Australian knows of this and appreciates it and honours it."
Defence force chief General David Hurley said over the next 10 weeks, the Australian Defence Force would complete its mission in Oruzgan and most would begin to return home.
"As this process begins, we reflect on the lasting friendship that has been forged with the people of Afghanistan and ties that we have established with our Afghan and coalition partners," he said.
Greens leader Christine Milne said Mr Abbott must now honour aid promises made by the former government.