When was xiangqi invented?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws and is regression-tested against the official 110-diagram repetition casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it against the engine before publishing.
Direct answer
The game as played today took shape in the Song dynasty (960–1279), roughly 900 to 1,000 years ago. A game called 象棋 is mentioned centuries earlier, but those references describe something different — the cannon, the piece that defines modern xiangqi, does not appear until artillery did.
What the evidence actually supports
In the Song period the board with river and palace, the full piece set including cannons, and a literature about the game all appear together. That is the point at which we can say the modern game existed, because we can see the modern game being described.
What it does not support
Name continuity is not game continuity. Tang and earlier mentions of 象棋 are real, but assuming they describe this game is an inference the sources do not license. The honest answer is Song-dynasty origin with older and genuinely unclear roots.
Related questions
Is xiangqi 3,000 years old?
No. That claim appears often and no surviving source supports it.
When was the cannon added?
With the Song-dynasty form, consistent with gunpowder artillery becoming familiar in China.