Set in the Qing dynasty in China, the film features a fictionalised story of the martial artist So Chan, who is popularly known as "Beggar So" and was one of the Ten Tigers of Canton. So Chan is the spoiled son of a wealthy general in Canton. Although he is lazy and illiterate, he excels in martial arts. While visiting a brothel, So falls in love with Yu-shang, a courtesan who dares to behave rudely towards him. So vies for Yu-shang's services with Chiu Mo-kei, a high-ranking government official. By outbidding Chiu, So inadvertently foils Yu-shang's attempt to assassinate Chiu to avenge her father, who was murdered by Chiu. Yu-shang agrees to marry So if he can win the title of "Martial Arts Champion". To win Yu-shang's hand-in-marriage, So enters the imperial martial arts contest to win the championship title. So's father helps him cheat his way through the written examination, while his personal expertise in martial arts carries him through the physical tests. So eventually emerges as champion, but just as the emperor is about to grant him the title, Chiu reveals that So is illiterate, proving that he cheated in the written examination. The enraged emperor orders So's family properties and possessions to be confiscated and decrees that they shall remain as beggars for the rest of their lives. So does not adapt well to his new life. He encounters Chiu on the streets and Chiu breaks his legs, preventing him from practising martial arts again. So is introduced by his father to join the Beggars' Sect, but he is ashamed when he finds out that Yu-shang's family actually leads the sect. He spends most of his time sleeping in seclusion. By coincidence, he meets an elderly beggar, whom he helped earlier, and the beggar attempts to cheer him up by healing his wounds and teaching him the "Sleeping Arhat Skill". When Yu-shang is kidnapped by Chiu later, So is shaken out of his delusional state as he wants to save her. He tricks the sect's members into electing him as their new chief, by pretending that he is possessed by the spirit of Hung Tsat-kung. Using his improved literacy, he reads the sect's ancient martial arts manual and learns seventeen of the "Eighteen Dragon Subduing Palms", while the last style is not shown in the book. Meanwhile, Chiu puts Yu-shang into a magical trance and attempts to use her as a puppet to assassinate the emperor and start a rebellion. So leads his beggar followers across to Great Wall of China to stop Chiu and they engage Chiu's forces while So saves Yu-shang in the nick of time. So uses all the skills he had learnt to fight Chiu, but they prove insufficient to completely defeat Chiu. When Chiu conjures a windstorm, So's manual falls out and forms a flip book which animates the first seventeen of the "Eighteen Dragon Subduing Palms". So suddenly realises that the final stance is a combination of the seventeen palms and he uses it to destroy Chiu and save the emperor. In the final scenes, Yu-shang agrees to marry So, and the grateful emperor asks So what reward he desires. So chooses to remain as a beggar king and the emperor expresses worries about So wielding much influence over the masses. So reminds him that as long as the people are cared for, there will be not enough beggars to pose a threat to the emperor. Before the film ends, So and Yu-shang are seen wandering the streets with their large family, using an imperial tablet to force rich people to give them money.