Shu is first mentioned in history as an alliance member with in overthrowing the Shang Dynasty, taking part in the Battle of Muye. In the archaeological record, post-Muye Shu showed a culture with advanced military technology equivalent to that of the Zhou states; however, Shu military technology stagnated for the next several centuries, mirrored by its lack of mention in recorded history.
Legend states that Shu was ruled at one time by the mythical king, Duyu , and his descendants. Shu was later ruled by the Kaiming kings. During the later half of the Spring and Autumn Period, Shu culture increasingly borrowed from and cultures; for example, Shu copied the practice of boat coffin burials from Ba. The archaeological evidence also shows that Shu interacted with the cultures to the south in Yunnan and Guizhou.
During the Warring States Period, Qin and Chu increasingly encroached on the Han river valley. Clashes with Shu inevitably began to arise; Shu fought Qin in 387 BC and Chu in 377 BC.
Conquest by Qin
Archaeological evidence shows that several gallery roads from Qin to Shu were built during the Warring States Period over extremely difficult terrain, the Qinling Mountains and the Daba Mountains. Although legend attributes the building of the first gallery road, the ''Stone Cattle Road'' , to the last Kaiming king , the roads were probably built by Qin to prepare for its invasion of the Sichuan basin.
Qin took advantage of a dispute between the last Kaiming king and his brother, the Marquis of Zu, to invade Shu. The Marquis of Zu had allied with Ba in attacking Shu. In response, the Kaiming king invaded Zu and sent the Marquis of Zu into exile in Qin. The Marquis of Zu then appealed to King Huiwen of Qin to invade Shu.
At this critical juncture, King Huiwen's two primary advisors, and Sima Cuo, held opposing views on invading Shu. Zhang Yi believed that Qin was close to winning control over the Central Plain, arguing instead for an attack on Qin's traditional nemesis, . On the other hand, Sima Cuo argued that invading Shu would greatly increase the agricultural wealth of Qin, tipping the balance of power in Qin's favor. King Huiwen agreed with Sima Cuo and sent his two advisors to lead the invasion of Shu. Qin defeated Shu and killed the last Kaiming king.
Shu under Qin rule
Qin turned Shu into a commandery and applied a strict process for integrating Shu into Qin. Qin sent officials to rule directly in Shu and actively encouraged migration of people from Qin into Shu. Although Qin tried to placate the populace by retaining the Kaiming rulers as the Marquis of Shu, Shu would rebel many times against Qin; in turn, Qin would respond by reinvading or suppressing Shu.
When King Huiwen died in 311 BC, a Qin official in Shu, Chen Zhuang, led a rebellion against Qin. Sima Cuo, Zhang Yi and Gan Mao led Qin forces into Shu and suppressed the rebellion. In 301 BC, Marquis Hui of Shu, a Kaiming descendant, rebelled. Sima Cuo led Qin forces into Shu and suppressed the rebellion. Marquis Hui's replacement, Marquis Wan, also rebelled against Qin. This time, the Qin governor in Shu, Zhang Ruo, suppressed the rebellion. After the last rebellion, the Kaiming descendants were permanently removed from actual power.
After securing its control over Shu, Qin used Shu as a place of exile, a practice later followed by the Han Dynasty.