Annelids and arthropods share a similar segmented organization of the body whose evolutionary origin remains unclear. The Hedgehog signaling pathway, prominent in arthropod embryonic segment patterning, has not been shown to have a similar function outside arthropods. We show that the ligand Hedgehog, the receptor Patched, and the transcription factor Gli are all expressed in striped patterns before the morphological appearance of segments in the annelid Platynereis dumerilii. Treatments with small molecules antagonistic to Hedgehog signaling disrupt segment formation. Platynereis Hedgehog is not necessary to establish early segment patterns but is required to maintain them. The molecular similarity of segment patterning functions of the Hedgehog pathway in an annelid and in arthropods supports a common origin of segmentation in protostomes.