Surface groups are determined among limit groups by their profinite completions. As a corollary, the set of surface words in a free group is closed in the profinite topology.