Communication between glial cells and neurons is emerging as a critical parameter of synaptic function. However, the molecular mechanisms underlying the ability of glial cells to modify synaptic structure and physiology are poorly understood. Here we describe a repulsive interaction that regulates postsynaptic morphology through the EphA4 receptor tyrosine kinase and its ligand ephrin-A3. EphA4 is enriched on dendritic spines of pyramidal neurons in the adult mouse hippocampus, and ephrin-A3 is localized on astrocytic processes that envelop spines. Activation of EphA4 by ephrin-A3 was found to induce spine retraction, whereas inhibiting ephrin/EphA4 interactions distorted spine shape and organization in hippocampal slices. Furthermore, spine irregularities in pyramidal neurons from EphA4 knockout mice and in slices transfected with kinase-inactive EphA4 indicated that ephrin/EphA4 signaling is critical for spine morphology. Thus, our data support a model in which transient interactions between the ephrin-A3 ligand and the EphA4 receptor regulate the structure of excitatory synaptic connections through neuroglial cross-talk.