Sydney: Australian combat troops have completed their withdrawal from Afghanistan, Prime Minister Tony Abbott said on Monday, marking the end of the nation’s longest war which left 40 of its soldiers dead.

Abbott announced that more than 1,000 troops would pull out from the restive southern province of Uruzgan before the end of the year during a surprise visit to their base at Tarin Kot in October.

The drawdown was completed on Sunday and most soldiers were expected to be home for Christmas.

“This war is ending, not with victory, not with defeat, but with hope that Afghanistan is a better place and Uruzgan in particular is a better place for our presence,” Abbott said.

“I firmly believe that to be the case.”

Canberra first committed troops to Afghanistan following the September 11, 2001 attacks on the United States, but they have been in Uruzgan since late 2005.

“We know that they’ve paid a high price — 40 dead and 261 seriously wounded — but that sacrifice has not been in vain,” Abbott said, referring to the 12-year mission.

“Uruzgan today is a very significantly different and better place than it was a decade ago.”

Some 400 Australians will remain in Afghanistan in non-combat roles, mostly in Kabul and Kandahar, but the bulk of the 1,550 Australians who had been serving there were now out of the country.

“None of them are expected to be involved in combat,” Abbott said of those remaining to work with the Afghan police and army.

Asked whether he was confident local authorities could take over security, Abbott said that Australians troops were happy with the progress made by the Afghan National Army (ANA) brigade they had mentored.

“We can’t predict the future, we have no crystal ball, but it’s very easy to be defeatist at a time like this and I don’t think there’s all that much evidence to justify it,” he said.

“The ANA has performed with considerable distinction over the last fighting season.”

Abbott said since the war in Afghanistan had begun, the Taliban regime had been replaced, Al Qaida and their sympathisers had been driven out of their safe havens, and a degree of stability had returned to the region.

“If you look at the benefits for our country, for Afghanistan and for the wider world, my conclusion is yes it has been worth it,” he said.

“But not for a second would I underestimate the price that has been paid by individuals and families.”

Defence Minister David Johnston said the drawdown was an enormous logistical achievement but the Australian mission there had closed and the majority of troops had left the country.

“They are in the air and on their way home,” he said.

More than 25,000 Australians have served in Afghanistan since 2001 when Australia joined close ally the United States to fight the Taliban and Al Qaida.