The 2004 Washington gubernatorial race was the closest statewide election in US history: after two machine counts and a final manual recount, Democrat Christine Gregoire led Republican Dino Rossi by just 129 votes out of 2.8 million cast. Rossi's supporters challenged the outcome in court, claiming that Gregoire's margin would be erased if invalid votes were removed from the candidates' totals. Because the vote choices of these invalid voters are unknown, and must be estimated or assumed, statistical issues were at the center of the controversy. We served as expert witnesses in the election contest, and will discuss our findings and experiences. Because only aggregate election totals were available at the time of trial, estimating the behavior of individual invalid voters posed a particularly difficult problem of ecological inference. We will discuss techniques of ecological inference and our efforts to test the sensitivity of assumptions about collective voter behavior made by both sides in court. In the light of these issues, an important contribution that statisticians can make is to prescribe statistical methodology appropriate for future close elections. We suggest some developments toward this goal.