Dendrite pruning is critical for sculpting the final connectivity of neural circuits as it removes inappropriate projections, yet how neurons can selectively eliminate unnecessary dendritic branches remains elusive. Here, we show that calcium transients that are compartmentalized in specific dendritic branches act as temporal and spatial cues to trigger pruning in Drosophila sensory neurons. Calcium transients occurred in local dendrites at ~3 hours before branch elimination. In dendritic branches, intrinsic excitability increased locally to activate calcium influx via the voltage-gated calcium channels (VGCCs), and blockade of the VGCC activities impaired pruning. Further genetic analyses suggest that the calcium-activated protease calpain functions downstream of the calcium transients. Our findings reveal the importance of the compartmentalized subdendritic calcium signaling in spatiotemporally selective elimination of dendritic branches.