Flat silicon samples were irradiated with 40 fs, 800 nm laser pulses at an intensity at the best focus of 2·1018 Wcm−2, in the presence of a pre-plasma on the sample surface. X-ray emission in the spectral range from 2 to 30 keV was detected inside and outside the plane of incidence, while varying pre-plasma scale length, laser intensity, and polarization. The simultaneous detection of 2ω and 3ω/2 emission allowed the contributions to the X-ray yield to be identified as originating from laser interaction with either the near-critical density (nc) region or with the nc/4 region. In the presence of a moderate pre-plasma, our measurements reveal that, provided the pre-plasma reaches a scale-length of a few laser wavelengths, X-ray emission is dominated by the contribution from the interaction with the under dense plasma, where electron plasma waves can grow, via laser stimulated instabilities, and, in turn, accelerate free electrons to high energies. This mechanism leads also to a clear anisotropy in the angular distribution of the X-ray emission. Our findings can lead to an enhancement of the conversion efficiency of ultra short laser pulses into X-rays.