Mediator occupies a central role in RNA polymerase II transcription as a sensor, integrator, and processor of regulatory signals that converge on protein-coding gene promoters. Compared to its role in gene activation, little is known regarding the molecular mechanisms and biological implications of Mediator as a transducer of repressive signals. Here we describe a protein interaction network required for extraneuronal gene silencing comprising Mediator, G9a histone methyltransferase, and the RE1 silencing transcription factor (REST; also known as neuron restrictive silencer factor, NRSF). We show that the MED12 interface in Mediator links REST with G9a-dependent histone H3K9 dimethylation to suppress neuronal genes in nonneuronal cells. Notably, missense mutations in MED12 causing the X-linked mental retardation (XLMR) disorders FG syndrome and Lujan syndrome disrupt its REST corepressor function. These findings implicate Mediator in epigenetic restriction of neuronal gene expression to the nervous system and suggest a pathologic basis for MED12-associated XLMR involving impaired REST-dependent neuronal gene regulation.