Australia expects to pull out most of its troops from Afghanistan nearly a year earlier than planned, the prime minister has announced, saying Australian soldiers have nearly completed their mission to transfer security responsibilities to Afghan forces in the decade-long war.

ulia Gillard cited security improvements and the death of Osama bin Laden and many of al-Qaida's senior leaders among the reasons behind the accelerated withdrawal, which will likely see most troops home by the end of 2013. But one opposition politician suggested the strategy was an attempt by Gillard to win over war-weary voters ahead of federal elections.

"This is a war with a purpose. This is a war with an end," Gillard said in a speech to the Australian Strategic Policy Institute in Canberra. "We have a strategy, a mission and a timeframe for achieving it."

Australia has 1,550 troops in Afghanistan, the largest force provided by any country outside Nato. The soldiers' primary objective has been training an Afghan National Army brigade to take responsibility for security in Uruzgan province.

Australia had originally planned to withdraw its troops by the end of 2014, though Gillard had hinted at an early exit in November when she said the mission could be finished before then. The US plans to withdraw all combat troops from Afghanistan by the end of 2014.

Gillard said she expected the Afghan president, Hamid Karzai, to announce in the next few months the transition of security responsibilities to Afghan forces in Uruzgan and other provinces. Once that starts, it will take 12 to 18 months to complete. Based on that timeframe, most of Australia's troops would be out of Afghanistan by the end of 2013.

However, Gillard declined to give a specific date for the conclusion of the withdrawal, saying the start of the process was dependent upon Karzai's announcement.

"When this is complete, Australia's commitment in Afghanistan will look very different to that which we have today," Gillard said. "We will have completed our training and mentoring mission ... And the majority of our troops will have returned home."

Australia will consider keeping some special forces soldiers in Afghanistan beyond 2014, and will help fund the costs of Afghan security forces, Gillard said. The prime minister said she and Karzai will sign a partnership agreement at a meeting of Nato nations' leaders in Chicago next month.

"Australia has an enduring national interest in ensuring that Afghanistan does not again become a safe haven for terrorists," Gillard said.

Australia's military deployment in Afghanistan maintains bipartisan political support, but opinion polls show the popularity of the commitment among the Australian public has plummeted amid the rising the death toll. Thirty-two Australian soldiers have been killed in the conflict.

Australia's federal elections are due next year, and one of Gillard's political foes suggested the early withdrawal was an attempt by the prime minister to boost support for her unpopular Labor party.

"It would be a shameful thing if, after nearly 12 years of deployment in Afghanistan and the loss of more than 30 Australian lives, this mission was foreshortened for reasons of domestic political convenience for the Labor party rather than on the basis of the advice of the military commanders in the field," opposition senator George Brandis told Sky News ahead of Gillard's announcement.

But opposition leader Tony Abbott signalled support for the early withdrawal, telling reporters in Melbourne he had no reason to believe "it shouldn't be possible to finish the job sooner rather than later".

Citing the deaths of Australian soldiers in the conflict, Abbott said, "We want to make sure that sacrifice has been worthwhile and that will happen if our troops come home soon with their mission accomplished."