We examine an elliptic equation in a domain Ω whose boundary ∂Ω is countably (m-1)-rectifiable. We also assume that ∂Ω satisfies a geometrical condition. We are interested in an overdetermined boundary value problem (examined by Serrin [Arch. Ration. Mech. Anal. 43 (1971)] for classical solutions on domains with smooth boundary). We show that existence of a solution of this problem implies that Ω is an m-dimensional Euclidean ball.