He won the federal 2007 election and was Australia 's 26th prime minister until 24 June 2010 , when his deputy Julia Gillard challenged and replaced him . Following the 2010 Australia election , he became Foreign Minister . He was the 26th Prime Minister of Australia ( 2007 â `` 2010 ) and is currently the Minister for Foreign Affairs .