The complete characterization of spatial coherence is extremely di cult because the mutual coherence function (MCF) is a complex-valued function of four independent Cartesian coordinates. This di culty limits the ability to control and to optimize the spatial coherence in a broad range of key applications. Here we propose an e cient and robust scheme for measuring the complete MCF of an arbitrary partially coherent beam using self-referencing holography, which does not require any prior knowledge or making any assumptions about the MCF. We further apply our method to lensless di ractive imaging, and experimentally demonstrate the reconstruction of a phase object under spatially partially coherent illumination. This application is particularly useful for imaging at short wavelengths, where the illumination sources lack spatial coherence and no high-quality imaging optics are available.