Xiangqi has a long history. Though its precise origins have not yet been definitely confirmed, the earliest indications reveal the game may have been played as early as the 4th century BC, by Tian Wen (田文), the Lord of Mengchang (孟嘗君) for the state of Qi, during the Warring States Period. (See chess in early literature or timeline of chess.) Judging by its rules, Xiangqi was apparently closely related to military strategists in ancient China. The ancient Chinese game of Liubo may have had an influence as well.
The word Xiàngqí's meaning "figure game" can also be treated as meaning "constellation game". Sometimes the xiàngqí board's "river" is called the "heavenly river", which may mean the Milky Way; previous versions of xiàngqí may have been based on the movements of sky objects.
During the Spring and Autumn Period and the Warring States Period, wars were fought for years running. A new strategy board game was patterned after the array of troops (according to a hypothesis by David H. Li, this was developed by Han Xin in the winter of 204 BC-203 BC to prepare for an upcoming battle). This was the earliest form of Xiangqi.
During the Cao Wei, Jin and Northern and Southern Dynasties, a kind of strategy game was popular among the people. It laid a foundation for the finalized pattern of Xiangqi. In ancient times, both highbrows and lowbrows enjoyed Xiangqi.
During the reign of Suzong of the Tang Dynasty, Prime Minister Niu Sengru wrote a fictional story about Xiangqi. That occurred during the Baoying period, so it was named Baoying. Baoying had six pieces and produced a significant influence on Xiangqi in subsequent years.
Three forms of the game took shape after the Song Dynasty. One of them consisted of 32 pieces. They were played on a board with 9 vertical lines and 9 horizontal lines. Popular in those days was a board without a river borderline; the Korean game of janggi is derived from this earlier riverless version. The river borderline was added later, and this form of the game has lasted to the present day.
With the economic and cultural development during the Qing Dynasty, Xiangqi entered a new stage. Many different schools of circles and players came into prominence. With the popularization of Xiangqi, many books and manuals on the techniques of playing the game were published. They played an important role in popularizing Xiangqi and improving the techniques of play in modern times.