Sedimentary rock from the Gessoso-solfifera Formation (Messinian) in the Vena del Gesso Basin (northern Italy) containing immature (Ro = 0.25%) S-rich organic matter was artificially matured by hydrous pyrolysis at temperatures from 160 to 330°C for 72 h to study the diagenetic fate of n-C37 and n-C38 di- and tri-unsaturated methyl and ethyl ketones (alkenones) biosynthesised by several prymnesiophyte algae. During early diagenesis, the alkenones are incorporated into the kerogen by both sulphur and oxygen cross-linking as indicated by chemical degradation experiments with the kerogen of the unheated sample. Heating at temperatures between 160 and 260°C, which still represents early stages of thermal maturation, produces large amounts (up to 1 mg/g TOC) of S-bound, O-bound, and both S- and O-bound n-C37 and n-C38 skeletons, saturated n-C37 and n-C38 methyl, ethyl, and mid-chain ketones, C37 and C38 mid-chain 2,5-di-n-alkylthiophenes, C37 and C38 1,2-di-n-alkylbenzenes, and C37 and C38 n-alkanes. With increasing thermal maturation, three forms of the n-C37 and n-C38 skeletons are relatively stable (saturated hydrocarbons, 1,2-di-n-alkylbenzenes and saturated ketones), whereas the S- and O-bound skeletons are relatively labile. These results suggest that in natural situations saturated ketones with an n-C37 and n-C38 skeleton can be expected as well as the corresponding hydrocarbons.