Australia's combat and training operations in Afghanistan will start to be withdrawn, and most of the troops back home, as early as the middle of next year, Julia Gillard has announced.
Your browser does not support iFrames
This will mean the bulk of military operations will be over before the federal election.
''I'm now confident that Chicago will recognise mid-2013 as a key milestone in the international strategy,'' she said.
''A crucial point when the international forces will be able to move to a supporting role across all of Afghanistan.''
It was previously planned for the military withdrawal to be completed by the end of 2014 but in November Ms Gillard has hinted it could be earlier.
Declaring that ''the peoples of the world's democracies are weary of this war'', Ms Gillard said Australia's troops will begin withdrawing as soon as Afghanistan's President, Hamid Karzai, declares Afghans will take responsibility for Oruzgan province, where 1550 Australian special forces and mentoring taskforce personnel are based.
Mr Karzai is expected to make that announcement at the end of this month. After that, Ms Gillard said the withdrawal should take 12 to 18 months and ''Australia's commitment in Afghanistan will look very different to what we have today.
''We will have completed our training and mentoring with the [Afghan] 4th Brigade. We will no longer be conducting routine frontline operations with the Afghan National Security Forces.
''The Australian-led provincial reconstruction team will have completed the work and the majority of our troops will have returned home.''
Apart from a brief absence, Australia has been in Afghanistan since 2001. Thirty-two soldiers have been killed and 219 personnel wounded.
Ms Gillard said there will probably be more casualties before the withdrawal is completed. ''There will be new days of grief,'' she said.
Australia will remain committed after the withdrawal. Some special forces will stay to help with training or to conduct counterinsurgency operations.
There will be continuing economic development assistance and Ms Gillard announced that Australia will help pay for aid and military funding for Afghanistan's security forces.
It has been estimated the Afghan military and police forces will need at least $4.1 billion a year from the international community once the coalition forces have gone.
''Australia has an enduring national interest in ensuring that Afghanistan does not again become a safe haven for terrorists,'' she said. ''I will go to Chicago prepared for Australia to pay our fair share.''
Ms Gillard's speech comes against the backdrop of intense co-ordinated Taliban attacks in Afghanistan at the weekend. She said these attacks are a sign of desperation.
''The weekend's renewed insurgent attacks in Kabul remind us that as the insurgency comes under sustained pressure in the field, the prospect of high-profile attacks aimed at disproportionate global public impact remains,'' she said.
Amid rising criticism of the war, Ms Gillard stressed it has not been a waste of lives and money but is a war with a purpose and an end and ''we are serving our national interest in Afghanistan''.
Opposition leader Tony Abbott said that ''we all want our troops to come home as soon as possible'', but that it was important the mission was fulfilled before any withdraw began.
Mr Abbott - who has toured Afghanistan twice - gave his cautious support to Ms Gillard's expected announcement, saying that ''there was no reason to suspect the job could be finished earlier than later''.
Shadow attorney-general George Brandis said it was ''shameful'' if the decision to withdraw troops had been made for political purposes.
''It would be a shameful thing if ... this mission was foreshortened for reasons of domestic political convenience for the Australian Labor Party rather than on the basis of the military commanders in the field,'' Senator Brandis said today.
''Having said that, we will listen to what the Prime Minister has to say and address the situation again no doubt later in the day.''
Retired general Jim Molan, coalition chief of operations in Iraq in 2004-05, said it was appropriate to end combat operations next year but warned that a premature withdrawal could result in Afghan armed forces being ''torn to bits.''
''Going in 2014 is most appropriate, the real challenge is what we do between now and then,'' he said.
Gen Molan said it was important that Australian troops remained for a period of time after the handover of control to Afghan forces to ensure stability.
''My fear is that there will be a temptation to transition to local control some time this year, and then have our troops, except for a very small number, immediately leave,'' he said.
While some parts of the Afghan armed forces were ready for a withdrawal of Australian troops, others were not and their biggest test would come when they were on their own, without artillery support and without intelligence capabilities.
''The fear that we have all got is that they will be torn to bits very quickly by a determined local force,'' Gen Molan said.
''That force will be spread all over the province, and the real problem will be that the Taliban can concentrate against each small part of it.''
Greens Leader Christine Milne has welcomed the news that Australia is poised to withdraw troops from Afghanistan, and says the troops should be brought home "straight away".
Senator Milne said the war had been a failure on "just about every level", referring to the high number of civilian deaths, the continued bombing of the Green Zone and the 32 Australian deaths.
"From the Greens view it is time we brought the troops home safely," she told reporters in Canberra this morning.
With Jessica Wright