The film is set in Dengfeng, Henan, during the warlord era of early Republican China. The warlord Hou Jie defeats a rival named Huo Long and seizes control of Dengfeng. Huo Long flees to Shaolin Temple to hide but Hou Jie appears and shoots him. Hou Jie ridicules the Shaolin monks before leaving.
Feeling disadvantageous with his sworn brother, Song Hu, Hou Jie sets a trap for Song in a restaurant, under the guise of agreeing to his daughter's engagement to Song's son. Meanwhile, Hou Jie's deputy, Cao Man, feeling that he was being used by Hou and that he deserves better, decides to betray Hou. Cao Man sends assassins to murder Hou Jie and his family. Hou Jie manages to fatally wound Song Hu with his handgun, but Song still saves Hou to allow him to escape from the assassin's ambush before succumbing to his injuries. Hou Jie manages to escape together with his daughter, but his daughter was severely injured when a carriage knocked her down while she is fleeing, and worsen when they fall off a cliff. Hou Jie's wife is rescued by some passing-by Shaolin monks, who were stealing rice from the military granary to help the refugees living near the temple. In desperation, Hou Jie brings his daughter to Shaolin, begging the monks to save her life, but it is too late and she dies of her injuries. Hou Jie's wife blames him for the death of their daughter and leaves him. Hou Jie attacks the monks in anger but is quickly subdued.
Hou Jie becomes disillusioned and wanders near Shaolin, until he meets the cook monk Wudao, who provides him with food and shelter. Hou Jie feels guilty for his past misdeeds and decides to become a monk and atone for his sins. During his stay in Shaolin, Hou Jie gradually understands Shaolin's principles through study and practising martial arts, mends his ways and finds peace and enlightenment from his heart. One day, Hou Jie overhears that Cao Man, who has taken control over his army, is oppressing the people by forcing them to unearth Chinese relics. Cao Man sells the relics to foreigners in exchange for advanced weaponry, after which he will have the labourers massacred to silence them. Hou Jie shows up to save some labourers and exposes himself in the process.
When Cao Man hears that Hou Jie is still alive, he leads his soldiers to the Shaolin temple to capture Hou. Hou Jie volunteers to distract Cao Man while the monks secretly break into Cao's house to save the imprisoned labourers. The plan succeeds but Hou Jie's senior, Jingneng, is brutally killed by Cao Man while buying time for his juniors to escape. Upon returning to Shaolin Temple, the monks decide that they need to evacuate the temple to avoid further trouble. Wudao leads the refugees away while Hou Jie and the other monks remain behind to defend the temple. By then, Cao Man arrives with his troops and orders an attack on Shaolin. At the same time, the foreigners feel that they have been cheated and they bombard Shaolin with artillery, resulting in heavy casualties for both the Shaolin monks and Cao Man's forces. Hou Jie defeats Cao Man in a fight and eventually sacrifices himself to save Cao from being crushed by a falling beam (returning the karma of Song Hu's sacrifice to save Hou during Song's assassination) and falls into the Buddha statue's palm and dies peacefully, leaving Cao feeling guilty. On the other hand, the surviving monks succeed in overcoming the enemy and stopping the bombardment and killed the foreigners. Meanwhile, the retreating refugees turn back and start crying when they see Shaolin Temple in ruins. Wudao tells them that the Shaolin spirit will continue to live in them even though the temple has been destroyed.
Afterwards, the scene cuts to an earlier period before the monks evacuate with the refugees, with Hou Jie meeting with his wife in the temple for the last time. Hou Jie passes the urn containing his daughter's cremated ashes to his wife, and she forgives Hou for his past, and accepts the fact that she can no longer be with him. Hou Jie admits that Cao Man's present evil doings stems from his own past misdeeds, thus he is responsible in guiding Cao back to the correct path. The scene ends with the monks practicing martial arts under snowfall, hinting that the monks and refugees settled down once again