A by-election was held in the Werriwa electorate in south-western Sydney on 19 March 2005, after the resignation of Labor MP Mark Latham, who had represented the electorate since 1994. Latham had been federal Opposition Leader since 2 December 2003 and led Labor to defeat at the 2004 election. He had become increasingly dissatisfied with politics and was struggling with recurring pancreatitis. He announced his resignation from parliament on 18 January 2005.
The governing Liberal and National Coalition chose not to contest the by-election, as Werriwa had long been considered a safe Labor seat; Labor has held it for all but nine years since 1906. Nevertheless, the by-election received substantial public attention, due to both the surprise nature of Latham's resignation and a brutal Labor preselection battle between two potential candidates. This resulted in the drafting of a compromise candidate, industrial mediator Chris Hayes. Labor increased their margin with 55.4 percent of the primary vote and 70.1 percent of the two-candidate-preferred vote. All of the 15 remaining candidates received a primary vote of less than 10 percent.
Latham was first elected to Werriwa at a 1994 by-election following the retirement of former Treasurer John Kerin. Latham was easily re-elected to Werriwa at the next four subsequent elections: in 1996, 1998, 2001 and 2004.