Fly photoreceptors are polarized cells, each of which has an extended interface between its cell body and the light-signaling compartment, the rhabdomere. Upon intense illumination, rhabdomeric calcium concentration reaches millimolar levels that would be toxic if Ca(2+) diffusion between the rhabdomere and cell body was not robustly attenuated. Yet, it is not clear how such effective attenuation is obtained. Here we show that Ca(2+) homeostasis in the photoreceptor cell relies on the protein calphotin. This unique protein functions as an immobile Ca(2+) buffer localized along the base of the rhabdomere, separating the signaling compartment from the cell body. Generation and analyses of transgenic Drosophila strains, in which calphotin-expression levels were reduced in a graded manner, showed that moderately reduced calphotin expression impaired Ca(2+) homeostasis while calphotin elimination resulted in severe light-dependent photoreceptor degeneration. Electron microscopy, electrophysiology, and optical methods revealed that the degeneration was rescued by prevention of Ca(2+) overload via overexpression of CalX, the Na(+)-Ca(2+) exchanger. In addition, Ca(2+)-imaging experiments showed that reduced calphotin levels resulted in abnormally fast kinetics of Ca(2+) elevation in photoreceptor cells. Together, the data suggest that calphotin functions as a Ca(2+) buffer; a possibility that we directly demonstrate by expressing calphotin in a heterologous expression system. We propose that calphotin-mediated compartmentalization and Ca(2+) buffering constitute an effective strategy to protect cells from Ca(2+) overload and light-induced degeneration.