Shallow-marine microporous limestones account for many carbonate reservoirs. Their formation, however, remains poorly understood. Due to the lack of recent appropriate marine analogues, this study uses a lacustrine counterpart to examine the diagenetic processes controlling the development of intercrystalline microporosity. Late Miocene lacustrine microporous micrites of the Madrid Basin (Spain) have a similar matrix microfabric as Cenomanian to Early Turonian shallow-marine carbonates of the Mishrif reservoir Formation (Middle East). The primary mineralogy of the precursor mud partly explains this resemblance: low-Mg calcites were the main carbonate precipitates in the Cretaceous seawater and in Late Miocene freshwater lakes of the Madrid Basin. Based on hardness and petrophysical properties, two main facies were identified in the lacustrine limestones: a tight facies and a microporous facies. The tight facies evidences strong compaction, whereas the microporous facies does not. The petrotexture, the sedimentological content, and the mineralogical and chemical compositions are identical in both facies. The only difference lies in the presence of calcite overgrowths: they are pervasive in microporous limestones, but almost absent in tight carbonates. Early diagenetic transformations of the sediment inside a fluctuating meteoric phreatic lens are the best explanation for calcite overgrowths precipitation. Inside the lens, the dissolution of the smallest crystals in favor of overgrowths on the largest ones rigidifies the sediment and prevents compaction, while partly preserving the primary microporous network. Two factors appear essential in the genesis of microporous micrites: a precursor mud mostly composed of low-Mg calcite crystals and an early diagenesis rigidifying the microcrystalline framework prior to burial.