The film is set in Foshan, China sometime in the late 19th century during the Qing dynasty. Liu Yongfu, the commander of the Black Flag Army, invites Wong Fei-hung on board his ship to watch a lion dance. Some sailors on board a nearby American ship hear the sound of firecrackers and mistakenly think that Liu's ship is opening fire at them, so they return fire and injure the dancers. Wong picks up the lion head and finishes the performance. Liu comments about the perilous situation China is in, and then gives Wong a hand fan inscribed with all the unequal treaties signed between China and other countries.
Wong is the martial arts instructor of the local militia in Foshan. He also runs his own traditional Chinese medicine clinic, Po-chi-lam, and has three apprentices: "Pork" Wing, "Bucktooth" So, and Kai. He meets Siu-kwan, the daughter of a sworn brother of his grandfather. Even though she is around the same age as him, he still has to address her as "13th Aunt" as she is considered more "senior" than him. They have romantic feelings for each other, but their relationship is restrained because it is seen as taboo in the conservative Chinese society of their time.
Leung Foon arrives in Foshan with an opera troupe to stage performances. He encounters 13th Aunt by chance, has a few clumsy encounters with her, and develops a crush on her. He also runs into trouble with the Shaho Gang, which terrorises and extorts money from local businesses. A fight breaks out between the gang and the local militia while Wong is having a meeting at a restaurant with the Governor of Foshan. The gangsters flee when they realise they are no match for Wong. The Governor blames Wong for the disturbance, and disbands and arrests the militia members. Wong confronts the Shaho Gang's leader, defeats him and captures him, but the authorities release him because no one wants to help Wong by testifying as a witness in court.
In the meantime, Leung Foon meets a northern martial artist, "Iron Vest" Yim, and decides to follow him. Yim wants to become famous and start a martial arts school in Foshan, but he needs to prove himself first. One night, the Shaho Gang sets fire to Po-chi-lam in revenge, after which they flee and take shelter under Jackson, an American official. In return for protection from the authorities, the Shaho Gang helps Jackson run his underground human trafficking ring by kidnapping Chinese women to be sent to America as prostitutes. When Wong and the Governor are watching an opera performance, the Shaho Gang and Jackson's men ambush them and try to assassinate the Governor and kill Wong. Their plan fails but many innocent people at the theatre are wounded. The Governor blames Wong and threatens to arrest and execute him, but allows him to give medical attention to the injured.
While tending to the injured people in his clinic, Wong meets an escaped Chinese labourer from America who relates his story of how he and his fellow labourers were treated in America. Just then, Yim arrives at Po-chi-lam and insists on challenging Wong to a fight to prove he is the better fighter. Yim leaves with Leung Foon after he is defeated by Wong and joins the Shaho Gang – even though Leung strongly objects to Yim working with the gang. Shortly after Yim left, the Governor shows up and orders his men to search Po-chi-lam for fugitives. While buying time for the labourer, 13th Aunt and "Bucktooth" So to escape, Wong and his apprentices fight with the Governor's men until 13th Aunt, "Bucktooth" So and the labourer have escaped. Wong then surrenders himself and is imprisoned along with his apprentices. In the meantime, the Shaho Gang kills the labourer, abducts 13th Aunt and takes her to their base. Bucktooth So escapes and goes to the prison to inform Wong. The prison guards release Wong and his apprentices out of respect for him.
Wong and his apprentices disguise themselves and infiltrate Jackson's base to find and rescue 13th Aunt. Wong engages Yim in a one-on-one fight and defeats him again. At the same time, Wong's apprentices and Leung Foon overcome the Shaho Gang and Jackson's men, and save 13th Aunt and the kidnapped women. Yim is killed by gunfire from Jackson's men. During the fight on the boat, the Shaho gang leader is thrown into the furnace and burned alive. At the critical moment, Jackson takes the Governor hostage at gunpoint, but Wong kills Jackson by using his fingers to flick an unused bullet into Jackson's forehead, and saves the Governor. At the end of the film, Wong accepts Leung as his fourth apprentice and they take a group photo in Po-chi-lam.
Once Upon a Time in China was released in Hong Kong on 15 August 1991. The film was a box office hit and is largely credited with starting the period martial arts craze of the early to mid 1990s. It ran for almost two months, the longest duration for any of the series, and grossed $29,672,278 HKD in Hong Kong.
Once Upon a Time in China was given highly favorable reviews from film critics. Rotten Tomatoes reported a score of 88%.