Newly synthesized membrane proteins must be accurately inserted into the membrane, folded and assembled for proper functioning. The protein YidC inserts its substrates into the membrane, thereby facilitating membrane protein assembly in bacteria; the homologous proteins Oxa1 and Alb3 have the same function in mitochondria and chloroplasts, respectively. In the bacterial cytoplasmic membrane, YidC functions as an independent insertase and a membrane chaperone in cooperation with the translocon SecYEG. Here we present the crystal structure of YidC from Bacillus halodurans, at 2.4 Å resolution. The structure reveals a novel fold, in which five conserved transmembrane helices form a positively charged hydrophilic groove that is open towards both the lipid bilayer and the cytoplasm but closed on the extracellular side. Structure-based in vivo analyses reveal that a conserved arginine residue in the groove is important for the insertion of membrane proteins by YidC. We propose an insertion mechanism for single-spanning membrane proteins, in which the hydrophilic environment generated by the groove recruits the extracellular regions of substrates into the low-dielectric environment of the membrane.