There are many sources of error in counting votes on election day: the apparent winner might not be the rightful winner. Hand tallies of the votes in a random sample of precincts can be used to test the hypothesis that the wrong candidate was named the winner. This paper develops a conservative sequential test based on the vote-counting errors found in a hand tally of a simple or stratified random sample of precincts. The procedure includes a natural escalation of the audit: If the hypothesis that the apparent outcome is incorrect is not rejected at stage $s$, the sample size is increased. Eventually, either the hypothesis is rejected---and the election is certified---or all the precincts have been tallied manually. The test incorporates a priori bounds on the errors in each precinct. It allows different error thresholds to be set in different precincts to reflect differences in voting technology or precinct sizes. The procedure involves the margin in the race, the number of precincts in the race and the vote counts in each precinct, including undervotes and invalid ballots. It is not optimal, but it is conservative: the chance of erroneously concluding that the election result is correct if in fact the wrong person was named the winner is no larger than the nominal significance level.