Profile: Julia Gillard
Julia Gillard, a Welsh-born lawyer, became Australia's first female prime minister in June 2010 - but was ditched by her party before elections three years later.
The man she ousted in a surprise leadership challenge, Kevin Rudd, ended up coming back to topple her in a dramatic reversal of fortune.
With defeat looming in elections due in September, the divided and embattled Labor Party opted for Mr Rudd, hoping he would win more votes.
Ms Gillard had led her party into the 2010 general election, but public unease over Labor infighting left her struggling, and the poll delivered Australia's first hung parliament in decades.
Although last year's fiery speech in parliament accusing opposition leader Tony Abbott of misogyny drew global attention, domestically voters failed to warm to her.
Throughout Ms Gillard's time in office, Mr Rudd remained popular with voters. He continued to dog his one-time ally, and she was forced to face down two leadership challenges before losing a third in June 2013.
Born in the Welsh port town of Barry in 1961, Ms Gillard migrated to Australia with her parents when she was four.
An outstanding student in her home town, Adelaide, she became president of the Australian Union of Students at Melbourne University in 1983.
She worked as a lawyer for a firm specialising in class actions and industrial relations, becoming partner at Slater and Gordon in 1990.
Moving into politics, she became the chief-of-staff to Victoria state opposition leader John Brumby, and then won a seat in parliament in 1998.
Kevin Rudd entered parliament at the same time as Ms Gillard and they formed an alliance in 2006.
While in the Rudd government she held several portfolios, including minister for employment and workplace relations, minister for education, and minister for social inclusion - as well as the deputy prime minister post.
She has been described as a good negotiator and a consensus politician - a sharp contrast to Mr Rudd, who was criticised by some for his top-down style of leadership.
Jacqueline Kent, who wrote a biography of Ms Gillard, called her persistent, focused and very bright. "And she's also got very good Labor - traditional Labor - social values," she said.
'Not going to sit idly by'
It was in 2010 that Ms Gillard moved to the very top, ousting Mr Rudd as he changed direction over a high-profile carbon trading scheme policy.
She said she had initiated the challenge - which took many by surprise - because his government was losing its way.
"I love this country, and I was not going to sit idly by and watch an incoming opposition cut education, cut health and smash rights at work," she said.
She then led the party into a general election which saw Australia's first hung parliament in decades. Labor ended up forming a minority government which relied on independents for a wafer-thin majority.
But Ms Gillard stumbled almost immediately on asylum, announcing the creation of a processing centre on East Timor that it later transpired did not have the full support of that country's government.
She also struggled to distance herself from both party and public unease caused by the manner of Mr Rudd's removal - although she roundly defeated Mr Rudd in a leadership challenge in February 2012.
She saw her ratings slip against Mr Abbott, who said the Labor "instability" was "damaging Australia".
But it was Mr Abbott who prompted the speech from Ms Gillard that raised her profile around the world - a passionate and eloquent condemnation of misogyny within the opposition ranks.
'Getting things done'
Under Ms Gillard, the government passed into law its clean energy bill - which introduced an emissions trading scheme - and also a mining tax aimed at boosting government revenue amid a resources boom.
On asylum, Labor reversed policy, reopening offshore processing centres on Nauru and in Papua New Guinea as the number of boat arrivals climbed.
On tobacco, it enacted into law legislation that put strict controls on packaging, effectively removing branding, in a bid to reduce smoking.
Early in 2013, Ms Gillard set a poll date of 14 September, saying the announcement was "not to start the nation's longest election campaign" but to give "shape and order" to the year.
Yet Labor continued to be riven internally - divisions which worsened as the party's poll figures plummeted.
In March 2013 Mr Rudd declined to stand in another leadership challenge, but this failed to quell speculation that he, not she, could lead Labor into the polls.
And with less than three months to go, with Ms Gillard's approval ratings in freefall, his supporters forced a new challenge which he won.
Ms Gillard had said ahead of the party vote that whoever lost should resign, and she will now leave politics.