Store-operated calcium entry (SOCE), an important mechanism of Ca2+ signaling in a wide range of cell types, is mediated by stromal interaction molecule (STIM), which senses the depletion of endoplasmic reticulum Ca2+ stores and binds and activates Orai channels in the plasma membrane. This inside-out mechanism of Ca2+ signaling raises an interesting question about the evolution of SOCE: How did these two proteins existing in different cellular compartments evolve to interact with each other? We investigated the gating mechanism of Caenorhabditis elegans Orai channels. Our analysis revealed a mechanism of Orai gating by STIM binding to the intracellular 2-3 loop of Orai in C. elegans that is radically different from Orai gating by STIM binding to the N and C termini of Orai in mammals. In addition, we found that the conserved hydrophobic amino acids in the 2-3 loop of Orai1 are important for the oligomerization and gating of channels and are regulated via an intramolecular interaction mechanism mediated by the N and C termini of Orai1. This study identifies a previously unknown SOCE mechanism in C. elegans and suggests that, while the STIM-Orai interaction is conserved between invertebrates and mammals, the gating mechanism for Orai channels differs considerably.