The significant degradation that fossilized biomolecules may experience during burial makes it challenging to assess the biogenicity of organic microstructures in ancient rocks. Here we investigate the molecular signatures of 1.88 Ga Gunflint organic microfossils as a function of their diagenetic history. Synchrotron-based XANES data collected in situ on individual microfossils, at the submicrometre scale, are compared with data collected on modern microorganisms. Despite diagenetic temperatures of ∼150-170 °C deduced from Raman data, the molecular signatures of some Gunflint organic microfossils have been exceptionally well preserved. Remarkably, amide groups derived from protein compounds can still be detected. We also demonstrate that an additional increase of diagenetic temperature of only 50 °C and the nanoscale association with carbonate minerals have significantly altered the molecular signatures of Gunflint organic microfossils from other localities. Altogether, the present study provides key insights for eventually decoding the earliest fossil record.