Variously colored sedimentary rock composed mainly of sandlike quartz grains cemented by calcite (calcareous sandstone), clay, or iron oxide (ferruginous sandstone). The sand accumulated originally underwater in shallow seas or lakes, or on the ground along shorelines or in desert regions. The rounded quartz grains are 0.06–2 mm across.