Anna Leonowens (Jodie Foster) is a British widow who has come to Siam with her son Louis (Tom Felton) to teach English to the dozens of children of King Mongkut (Chow Yun-fat). She is a strong-willed, intelligent woman, and this pleases the King, who wants to modernize his country to keep it safe from the threat of colonialism, while protecting many of the ancient traditions that give Siam its unique identity. The King and Anna discuss the differences between Eastern and Western love, and the King dismisses the notion that a man can be happy with only one wife. In order to win the favors of Britain, the King orders a sumptuous reception and delegates Anna to organize it. During the reception, the King verbally spars graciously and wittily with Sir Mycroft Kincaid (Bill Stewart), of the East India Company, who accuses Siam of being a superstitious nation. At the end of the reception, the King dances with Anna.
Anna is enchanted by the royal children, particularly Princess Fa-Ying (Melissa Campbell). The little girl identifies with the spirit of the playful monkeys who live in the trees of the royal garden. When she suddenly takes ill of cholera, Anna is summoned to her chambers to say goodbye. She gets there just as Fa-Ying dies in King Mongkut's arms, and the two mourn together. Sometime later, when the King finds that one of the monkeys has "borrowed" his glasses, as his daughter used to do, he is comforted by his belief in reincarnation and the idea that Fa-ying may be reborn as one of her beloved animals. Lady Tuptim (Bai Ling), the King's new favorite concubine, was already engaged to marry another man, Khun Phra Balat (Sean Ghazi), when brought to the court. The King is kind to her, but she is unhappy and at last runs away, disguising herself as a young man and joining the monastery where her former fiancé lives. She is tracked down and brought back to the palace, and put on trial where she is caned. Anna, unable to bear the sight, tries to prevent the judgement of execution and is forcibly removed from the court. Anna's outburst prevents the king being unable to show clemency as to do so would show him to be beholden to her. Tuptim and Balat are beheaded publicly and Anna prepares to leave Siam.
Siam is under siege from what appears to be a British-funded coup d'état against King Mongkut, using Burmese soldiers. Mongkut sends out his brother Prince Chaofa (Kay Siu Lim) and his military advisor General Alak (Randall Duk Kim) and their troops to investigate. However, it turns out that Alak is the man behind the coup and he poisons the regiment, and kills Chaofa. He then flees Siam into Burma where he summons and readies his troops to invade Siam and kill the King and his children. The King's army is too far from the palace to engage the rebels so he announces a white elephant has been spotted so as to provide a pretext to flee the palace with his children and wives and give his armies time to get back. Anna returns to help the King and they acknowledge that her presence in his entourage will give credence to his claim. Mongkut plans to take his family to a monastery where he spent part of his life, but halfway through the journey they see Alak's army in the distance and know that they can not out run them. The King and his soldiers place high explosives on a wooden bridge high above a canyon floor, as Alak and his army approaches. The King orders his "army" to stay back and rides to the bridge with only two soldiers. Alak, in front of his army, confronts the King on the bridge.
Anna and Louis orchestrate a brilliant deception from their hiding spot in the forest: Louis uses his horn to replicate the sound of a bugle charge, as Anna "attacks" the area with harmless fireworks. The ploy works as the Burmese, believing the King has brought British soldiers, retreat in a panic. Alak attempts to recall them, but his efforts prove to be futile. Alak stands alone, but the King refuses to kill him, saying that Alak shall have to live with his shame. As the King turns to ride back to Siam, Alak grabs his gun and aims at the King, but one of the King's guards detonates the explosives, blowing the bridge and Alak to pieces.
At the end of the film, the King has one last dance with Anna before she leaves Siam, and realizes that it is conceivable for one man to be pleased by only one woman. It is revealed that Chulalongkorn became a king after his father's death and abolished slavery, and instituted religious freedom with the help of his father's 'vision'.
Anna and the King received mixed reviews. On Rotten Tomatoes, it holds a 51% rating, based on 98 reviews, with the consensus stating that "Beautiful cinematography can't prevent Anna and the King from being boring and overly lengthy."  On a $92 million budget, the film grossed $39,263,420 domestically, but its international gross of $74,733,517 brought its worldwide gross to $113,996,937, making the film a modest financial success.
After reviewing the script, even after changes were made to try to satisfy them, the Thai government did not allow the film-makers to film in Thailand. The Thai authorities did not permit the film to be distributed in Thailand due to scenes that they construed as a disrespectful and historically inaccurate depiction of King Mongkut. Tony Dabbs, writing an opinion piece for the Thai newspaper The Nation, criticized the film ban.