The C. elegans defecation cycle is characterized by the contraction of three distinct sets of muscles every 50 s. Our data indicate that this cycle is regulated by periodic calcium release mediated by the inositol trisphosphate receptor (IP3 receptor). Mutations in the IP3 receptor slow down or eliminate the cycle, while overexpression speeds up the cycle. The IP3 receptor controls these periodic muscle contractions nonautonomously from the intestine. In the intestinal cells, calcium levels oscillate with the same period as the defecation cycle and peak calcium levels immediately precede the first muscle contraction. Mutations in the IP3 receptor slow or eliminate these calcium oscillations. Thus, the IP3 receptor is an essential component of the timekeeper for this cycle and represents a novel mechanism for the control of behavioral rhythms.