The Shang Dynasty is the first Chinese dynasty for which archaeology and contemporary writing agree, though the Chinese historiographical tradition, recorded centuries later in Sima Qian's Records of the Grand Historian, places a Xia Dynasty before it that has left no confirmed written trace. Shang rule is conventionally dated from around 1600 BCE, when Tang is said to have overthrown the last Xia king, to 1046 BCE, when King Wu of Zhou defeated the last Shang king, Di Xin, at the Battle of Muye. The dynasty moved its capital several times before settling at Yin, near modern Anyang in Henan province, from around 1300 BCE onward, which is why the period is often called the Yin Dynasty in later sources.
What is known of Shang religion and governance rests overwhelmingly on the oracle bones excavated at Anyang from 1899 onward, tortoise plastrons and cattle scapulae inscribed with questions put to royal ancestors and to Shangdi, then heated until they cracked and read as answers. These inscriptions record royal sacrifices, military campaigns, harvests and the king's own health, and they name a genealogy of Shang kings that later texts largely confirm. Bronze casting reached a very high technical level in this period, producing ritual vessels used to present food and wine offerings to ancestral spirits at state sacrifices, and Shang tombs, including the undisturbed tomb of the consort Fu Hao, held large quantities of bronze and jade and, in royal burials, human sacrifice. David Keightley's study of the oracle bone corpus remains the standard scholarly account of how this evidence reconstructs Shang belief and practice.