Tony Abbott came to Afghanistan on Monday to signal the end of the 12-year mission there and declare Australia's longest war had failed to secure victory.
But he declared it a job well done and that it was time for the troops to come home.
Accompanied by Labor leader Bill Shorten, in what is the only bipartisan visit since Australia first sent troops 12 years ago, the Prime Minister did not believe victory could be claimed but felt a positive difference was made.
''Australia's longest war is ending, not with victory, not with defeat, but with, we hope, an Afghanistan that is better for our presence here,'' he told assembled troops at the Tarin Kowt base.
''Our armed forces and our officials have done their duty. That duty never ends, although our duty here has.''
The Abbott government is also likely to adopt a hard line towards aid for Afghanistan after the last Australians leave next month.
While the previous Labor government declared Australia would maintain a strong aid presence beyond the withdrawal, Fairfax Media understands the Abbott government is not so keen.
There will be some assistance but a portion of the more than $4 billion in cuts to the aid budget the Coalition promised before the election would be at the expense of Afghanistan. It is in recognition that with the Western forces gone, the country will resort to its centuries-old practice of being controlled by warlords.
One condition the government is keen to place on the spending of aid money is that it at least has some say in its disbursement. In post-occupation Afghanistan, where the Taliban is expected to assume a dominant role, that is not considered a reality.
Mr Abbott visited Afghanistan three times as Opposition Leader, the most of any person in that position. This visit, conducted with the now customary surprise and secrecy, will be his last and the last of any Australian prime minister, ending a tradition that began in 2005.
Australia's commitment to Afghanistan has lasted four prime ministers and six opposition leaders, and has come at a price: 40 men killed, more than 200 wounded, and close to $8 billion spent.
More than 26,000 service personnel have rotated through the country.
Mr Abbott told the troops the withdrawal would be ''bitter sweet''.
''Sweet because hundreds of soldiers will be home for Christmas, bitter because not all Australian families have had their sons, and fathers and partners return,'' he said.
Australia still has about 1000 personnel at Tarin Kowt, the base in the Oruzgan province, who are due to be home by Christmas. Beyond that, an undefined number of special forces will remain. They will relocate to Kandahar and Kabul, and act as ''trainers''.
During the visit, Mr Abbott and Mr Shorten laid wreaths during a ceremony to mark the imminent withdrawal and the lead role Australia has had since 2010 in looking after Oruzgan.
Mr Shorten also addressed the troops. ''The troops have taken the vow of absence and risk, and of distance from families,'' he said.
''There are no words to thank you for the sacrifice and the ordinariness of the life we take for granted.
''It will be a great homecoming for a tremendous job.''
The ceremony was held around the Camp Holland memorial wall, which features the names of the 40 Australians, who along with another 74 US, Dutch and French troops, died in Oruzgan.
Controversially, the withdrawal plans include painting over the names, and the three large concrete panels on which they are inscribed will be broken up and buried.
There were suggestions the wall could be replicated in Australia and an announcement was expected later on Monday.
One claim of success from the visiting delegation was that the Australians had overseen the construction of more than 200 schools in Oruzgan, of which 26 were for girls, but questions remained as to how many were still functioning.
Afghan Interior Minister Mohammed Omer Daudzai told the ceremony the Australians "have been the best" of all who had served in the country. ''Whatever they have been doing here . . . they have always put the Afghan people first.''
Oruzgan governor Amir Mohammad Akhundzada said security had improved a lot but ''some threats still exist''.