Lafora disease (LD) is a progressive myoclonic epilepsy resulting in severe neurodegeneration followed by death. A hallmark of LD is the accumulation of insoluble polyglucosans called Lafora bodies (LBs). LD is caused by mutations in the gene encoding the phosphatase laforin, which reportedly exists solely in vertebrates. We utilized a bioinformatics screen to identify laforin orthologues in five protists. These protists evolved from a progenitor red alga and synthesize an insoluble carbohydrate whose composition closely resembles LBs. Furthermore, we show that the kingdom Plantae, which lacks laforin, possesses a protein with laforin-like properties called starch excess 4 (SEX4). Mutations in the Arabidopsis thaliana SEX4 gene results in a starch excess phenotype reminiscent of LD. We demonstrate that Homo sapiens laforin complements the sex4 phenotype and propose that laforin and SEX4 are functional equivalents. Finally, we show that laforins and SEX4 dephosphorylate a complex carbohydrate and form the only family of phosphatases with this activity. These results provide a molecular explanation for the etiology of LD.