He was elected an MP in 1974 and held several posts in the Cabinet, including Federal Treasurer (1977–83). He was twice leader of the Liberal Party in opposition (1985–89, 1995–96) before becoming Prime Minister of a coalition government. His government was re-elected in 1998, 2001, and 2004 but defeated by Labor under Kevin Rudd in 2007.