The stereoselective synthesis of O-galactosides of benzoyl-substituted heterocyclic ketene aminals was investigated. The benzoyl-substituted heterocyclic ketene aminals 1-4 reacted with 2,3,4,6-tetra-O-acetyl-α-d-galactopyranosyl bromide (5) in the presence of calcium hydride to give O-galactosides of benzoyl-substituted heterocyclic ketene aminals 6-9 with the Z-configuration. In comparison, 1-2 reacted with 5 in the presence of mercuric cyanide to give O-galactosides of benzoyl-substituted heterocyclic ketene aminals 10-11 with the E-configuration. Satisfactory results have been obtained in terms of both stereoselectivity and yield, and the β-anomers are the sole products.