The Assassin is loosely based on the late seventh-century martial arts story “Nie Yinniang” by Pei Xing, a core text in Chinese swordsmanship and wuxia fiction. The film is set in China during the Zhenyuan reign period (785 to 805) in the middle of the Tang dynasty, a few years after the An Lushan rebellion (755 to 763). The circuit of Weibo, though nominally a part of the Tang Empire, is de facto ruled independently by military governor Tian Ji’an.

The film centers on Nie Yinniang, an assassin who is directed to slay corrupt government officials by her master, Jiaxin, a nun who raised her from the age of ten. When Yinniang displays mercy by failing to kill during her duties, Jiaxin punishes her with a ruthless assignment designed to test Yinniang’s resolve: she is sent to the distant circuit of Weibo in northern China to kill its military governor, her cousin Tian Ji’an, to whom she was betrothed as a child.

As Princess Jiacheng recounts to her when she arrives, the betrothal was a consequence of Jiacheng’s own marriage. Jiacheng was married off to an official of Weibo to quell unrest in Weibo, whereupon she adopted her husband’s son, Tian Ji’an as her own. At her request, Tian Ji’an was betrothed to Yinniang at the age of fifteen. However, the betrothal was canceled in favor of a politically pressing marriage, and Yinniang was sent off to live with Princess Jiacheng’s sister the nun Jiaxin. Yinniang wrestles with her mission to kill Tian Ji’an, especially in front of his children.
When Yinniang’s uncle Tian Xing expresses views Tian Ji’an finds offensive in a meeting of state, Tian Ji’an demotes Tian Xing and sends him away to Linqing under the protection of Nie Feng, Yinniang’s father. They are soon ambushed, but Yinniang arrives in time to rescue them. She accompanies the wounded survivors to a village where they meet a young mirror-polisher.

Yinniang protects Tian Ji’an on the journey where she was expected to kill him, and eventually tells Jiaxin that killing him while his sons were young would have plunged Weibo into chaos. Jiaxin dismisses Yinniang for her emotional failures after praising her unmatched martial skills. Yinniang then spares the life of the old nun before joining the traveling mirror-polisher as his guardian.