Media playback is unsupported on your device Media caption Julia Gillard: "Australia's commitment in Afghanistan will look very different"

Prime Minister Julia Gillard says Australia will withdraw its troops from Afghanistan earlier than planned.

Ms Gillard made the announcement in a speech in Canberra, and ahead of a key Nato conference on Afghanistan in Chicago next month.

She said troops would begin pulling out this year and most would be home by the end of 2013 - an election year in Australia.

Most international troops are due to leave Afghanistan by the end of 2014.

Nato is in the process of handing over security control to local forces - some strategically important areas of the south and east have already been transferred to Afghan forces.

There are currently about 130,000 Nato troops serving in Afghanistan from 50 contributing nations, the International Security and Assistance Force says.

Australia has some 1,550 troops serving in Afghanistan, mainly in the Uruzgan region.

Since 2001, a total of 32 Australian soldiers have been killed in the country, according to Australian media.

Analysis At least three factors are driving Julia Gillard's decision. The first is military. Uruzgan province, where most Australian "Diggers" are based, is now relatively secure, so the need for non-Afghan troops has diminished. Second, the leaders of all contributing forces have been talking about withdrawal for some time. Whether it is President Obama, Prime Minister Cameron or President Sarkozy, it has been evident the feeling is this conflict has run its course: Ms Gillard is part of that process. Third, Ms Gillard faces a general election sometime next year, and some of her political opponents have already accused the prime minister of using troop withdrawals as part of a strategy to improve her popularity. But while the refrain "the prime minister who brought the troops home" could have powerful resonance in some places, the date of the Diggers' final pullout will not just be decided by Ms Gillard alone. And the relatively small number of troops involved - some 1,500 - means the electoral impact of any parade-like returns are likely to be limited.

The new timeline would likely see most of the troops back home before the election next year.

Ms Gillard's announcement, in a speech delivered to the Australian Strategic Policy Institute, came two days after a spate of militant attacks in Kabul lasting for 18 hours left more than 50 people dead.

Afghan President Hamid Karzai has linked Sunday's militant attacks to intelligence failures, especially on the part of Nato, but praised the performance of Afghan troops.

'Different' picture

Ms Gillard said she would raise the plan for Australia's troop withdrawal at the Nato conference on Afghanistan in Chicago on 21 May.

The government had previously said most Australian troops would leave in 2014.

But the prime minister said withdrawal would begin once Afghans took on responsibility for security in Uruzgan province - where the majority of Australian troops are based.

She said she expected an announcement on this from Mr Karzai in "coming months", after which the pull-out would take between 12 and 18 months.

"When this is complete, Australia's commitment in Afghanistan will look very different to that which we have today," Ms Gillard said.

Australia would also commit to paying its ''fair share'' toward international aid and military funding for Afghan security forces after 2014, she added.

It was also prepared to consider maintaining a limited number of troops, she said, and would commit to helping to train Afghan forces.

Ms Gillard's minority administration has been slipping in popularity and some observers say Labor could be heading for defeat at the polls.