Limestone (calcium carbonate CaCO3) is a type of carbonate sedimentary rock which is the main source of the material lime. It is composed mostly of the minerals calcite and aragonite, which are different crystal forms of CaCO3. Limestone forms when these minerals precipitate out of water containing dissolved calcium.