Gillard was elected at the 1998 federal election to the House of Representatives seat of Lalor, Victoria, for the Australian Labor Party. Following the 2001 federal election, Gillard was elected to the shadow cabinet with the portfolios of Population and Immigration. The Reconciliation and Indigenous Affairs and the Health portfolios were added in 2003. In December 2006, Kevin Rudd was elected Labor leader and Leader of the Opposition, with Gillard as deputy leader.
Gillard became the Deputy Prime Minister upon Labor's victory in the 2007 federal election, also serving as Minister for Education, Employment and Workplace Relations. On 24 June 2010, after Rudd lost the support of his party and stood aside, Gillard became federal leader of the Australian Labor Party and thus the Prime Minister, the first female holder of the office.
The 2010 federal election saw the incumbent Gillard Labor government elected to a second term over the Coalition opposition, led by Tony Abbott, and formed a minority government with support of an Australian Greens MP and three independent MPs.