After Federation in 1901, Deakin became the inaugural Attorney-General of Australia in the ministry led by his close friend Edmund Barton. He succeeded Barton as prime minister in September 1903. Two subsequent elections in 1903 and 1906 produced an even split between three parties, with Deakin’s Liberal Protectionists occupying an effective middle ground between the Free Traders and the Australian Labor Party (ALP). He left office in April 1904 following an unproductive first term, but returned in July 1905 and was able to form a functional government with the support of the ALP. He relinquished office again in August 1908.