Limestone is a sedimentary rock that is composed primarily of calcium carbonate (CaCO3). It is formed from the accumulation of layers of organic material, such as the shells of marine animals and plants. These materials are deposited on the sea floor, where they are compacted and cemented together over time by minerals like calcite. The end result is a hard, compact rock that is commonly used in construction, agriculture, and other industrial applications.