The maturation of RAS GTPases and approximately 200 other cellular CAAX proteins involves three enzymatic steps: addition of a farnesyl or geranylgeranyl prenyl lipid to the cysteine (C) in the C-terminal CAAX motif, proteolytic cleavage of the AAX residues and methylation of the exposed prenylcysteine residue at its terminal carboxylate. This final step is catalysed by isoprenylcysteine carboxyl methyltransferase (ICMT), a eukaryote-specific integral membrane enzyme that resides in the endoplasmic reticulum. ICMT is the only cellular enzyme that is known to methylate prenylcysteine substrates; methylation is important for the biological functions of these substrates, such as the membrane localization and subsequent activity of RAS, prelamin A and RAB. Inhibition of ICMT has potential for combating progeria and cancer. Here we present an X-ray structure of ICMT, in complex with its cofactor, an ordered lipid molecule and a monobody inhibitor, at 2.3 Å resolution. The active site spans cytosolic and membrane-exposed regions, indicating distinct entry routes for the cytosolic methyl donor, S-adenosyl-l-methionine, and for prenylcysteine substrates, which are associated with the endoplasmic reticulum membrane. The structure suggests how ICMT overcomes the topographical challenge and unfavourable energetics of bringing two reactants that have different cellular localizations together in a membrane environment-a relatively uncharacterized but defining feature of many integral membrane enzymes.