High-resolution optical microscopy suffers from a low contrast in scattering media where a multiply scattered wave obscures a ballistic wave used for image formation. To extend the imaging depth, various gating operations - confocal, coherence, and polarization gating - have been devised to filter out the multiply scattered wave. However, these gating methods are imperfect as they all act on the detection plane located outside a scattering medium. Here, we present a new gating scheme, called space gating, that rejects the multiply scattered wave directly at the object plane inside a scattering medium. Specifically, we introduced a 30 $mu$m-wide acoustic focus to the object plane and reconstructed a coherent image only with the ballistic wave modulated by acousto-optic interaction. This method allows us to reject the multiply scattered wave that the existing gating methods cannot filter out and improves the ratio of the ballistic wave to the multiply scattered wave by more than 100 times for a scattering medium more than 20 times thicker than its scattering mean free path. Using the coherent imaging technique based on space gating, we demonstrate the unprecedented imaging capability - phase imaging of optically transparent biological cells fully embedded within a scattering medium - with a spatial resolution of 1.5 $mu$m.