Techniques enabling in situ elemental and mineralogical analysis on extraterrestrial planets are strongly required for upcoming missions and are being continuously developed. There is ample need for quantitative and high-sensitivity analysis of elemental as well as isotopic composition of heterogeneous materials. Here we present in situ spatial and depth elemental profiles of a heterogeneous rock sample on a depth-scale of nanometres using a miniaturized laser ablation mass spectrometer (LMS) designed for planetary space missions. We show that the LMS spectra alone could provide highly detailed compositional, three-dimensional information and oxidation properties of a natural, heterogeneous rock sample. We also show that a combination of the LMS and Raman spectroscopy provide comprehensive mineralogical details of the investigated sample. These findings are of great importance for future space missions where quick, in situ determination of the mineralogy could play a role in the process of selecting a suitable spot for drilling.