Australia will complete its troop withdrawal from Afghanistan in September, in line with the United States and other allies.
The country's contribution to the NATO-led mission had once exceeded 15,000 personnel, but only 80 remain.
Australian Prime Minister Scott Morrison did not specify a date for the exit, but said: "In line with the United States and other allies and partners, the last remaining Australian troops will depart Afghanistan in September.
"The decision represents a significant milestone in Australia's military history."
NATO has said its troops will start withdrawing from the start of next month and will aim to complete the drawdown "within a few months".
British servicemen and women will "drawdown" in the country as part of the plans, with Defence Secretary Ben Wallace saying the UK Armed Forces will have "lasting memories" of Afghanistan.
Roughly 750 British personnel are still deployed to the country.
More than 39,000 Australian military personnel have served in Afghanistan since 2001, and 41 have been killed there.
Mr Morrison became emotional when reading the names of the Australian soldiers who had died between 2002 and 2014 but he said the Afghanistan campaign was worth the sacrifice.
"Freedom's always worth it. Australians have always believed that," he said.
"That's why Australians who have serviced in our defence forces have always pulled on that uniform.
"Pulling on that uniform and serving under that flag, defending our values and standing up for them is what Australians do and those 41 brave men have exhibited that more than any other Australian can ever hope to."
Australia's military legacy in Afghanistan has been tarnished in recent years with allegations of war crimes.
Last year, officials established an investigative agency to build criminal cases against Australian special forces suspected of committing crimes from 2005 until 2016.
A military report released in November found evidence that elite Australian troops unlawfully killed 39 Afghan prisoners, farmers and civilians.
The report recommended criminal investigations into 19 current and former soldiers.
Cover image: File image of an Australian Army soldier in Kabul, Afghanistan (Picture: Australian Department of Defence).