Australia will complete its troop withdrawal from Afghanistan in September in line with the United States and other allies, the prime minister said.
The country’s contribution to the Nato-led mission had once exceeded 15,000 personnel, but only 80 remain.
Scott Morrison did not specify a date for the withdrawal, 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.”
US president Joe Biden plans to withdraw the last 2,500 troops from Afghanistan before the 20th anniversary of the September 11 terrorist attacks on the United States that triggered the campaign.
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. He said the Afghanistan campaign was worth the sacrifice.
He said: “Freedom’s always worth it. Australians have always believed that. 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.”
Nato Secretary-General Jens Stoltenberg said the alliance’s full withdrawal would be completed within months, but did not mention the September 11 anniversary.
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 prisoner, farmers and civilians. The report recommended criminal investigations into 19 current and former soldiers.
Benjamin Roberts-Smith, Australia’s most highly decorated member of the armed services when he left the Special Air Service in 2013, has been accused by former colleagues of unlawful treatment of prisoners including illegal killings.
The former corporal, who was awarded the Victoria Cross and the Medal for Gallantry for his service in Afghanistan, has denied any misconduct.
Australia became a staunch ally in the US-led war on terror.
In 2003, then-president George W Bush described then-prime minister John Howard as a “man of steel” after Mr Howard committed Australian combat troops to back US and British forces in the Iraq invasion.