Richard Sharpe is a private in the 33rd Regiment of Foot in the British army, currently invading Mysore and advancing on the Tippoo Sultan's capital city of Seringapatam. Sharpe is contemplating desertion with his paramour, widow Mary Bickerstaff. His sadistic company sergeant, Obadiah Hakeswill, and company commander, Captain Morris, wish to use Mary as a prostitute and so engineer a scheme that results in Hakeswill deliberately provoking Sharpe into attacking him. The incident is witnessed by Morris and a junior officer, Ensign Hicks, resulting in Sharpe's court martial and the virtual death sentence of 2,000 lashes for the private. He is saved, however, when the regiment's commander, Arthur Wellesley, the later 1st Duke of Wellington, halts the punishment at 200 lashes. It emerges that Lieutenant William Lawford has requested Sharpe to join him in a special mission, which he agrees to with the guarantee that he will be made a sergeant if successful.
Lawford and Sharpe are ordered to pose as deserters to rescue Colonel Hector McCandless, chief of the British East India Company's intelligence service, Sharpe's flogging inadvertently providing the ideal cover story for them. Although Lawford is nominally in command, Sharpe quickly dominates the lieutenant by force of personality and, without authorization, brings Mary on the mission. Furthermore, Sharpe helps establish Lawford's cover story, having the lieutenant pose as a thieving clerk who is deserting with Sharpe after witnessing the latter's punishment. They are soon captured by scouts from the Tippoo's army and led to Seringapatam where they meet Colonel Gudin, a French military adviser to the Tippoo. During their interrogation, the Tippoo enters and orders them load muskets, which takes Lawford far longer to do so than Sharpe, and then kill a British prisoner. As Sharpe prepares to execute the prisoner, who is actually Colonel McCandless, he is able to covertly tell McCandless that he is a double agent and learns that the Tippoo has set a trap for the British by mining the weakest (and thus most inviting) portion of the city walls and that they can get a message to the British via a spy in the city. Upon his attempt to shoot McCandless the musket misfires so Sharpe beats him instead before being halted by the Tippoo.
Lawford and Sharpe are enlisted with Gudin's troops, whilst Mary is sent to work as a servant in the household of one of the Tippoo's generals, Appah Rao, who, unknown to the Tippoo, secretly supports the British since they plan to restore the Hindu Rajah if the Muslim Tippoo is defeated. Whilst Lawford is furious at Sharpe for trying to kill McCandless, Sharpe reveals what he learned from the colonel and that he knew that he would not be able to shoot McCandless since he recognized that the powder they were given was bad. His attempt to execute, and subsequent beating of, the colonel was to help prove that they were sincere deserters. As they search for the British spy, they start to earn the trust of their enemies as Lawford kills a British scout as part of a loyalty test and Sharpe helps defend a Mysore encampment which is attacked by the British. During this attack Sharpe encounters Hakeswill and tries to kill him but is stopped by Gudin who wants prisoners. Several other members of his former regiment are captured, though Morris escapes, and they are led back to Seringapatam where Hakeswill spots Lawford in the crowd. Sharpe is rewarded for his actions in the attack by the Tippoo and is allowed to visit Mary. When they reunite, however, he finds that she has left him for one of Appah Rao's men, Kunwar Singh, news which Sharpe takes in good grace. Meanwhile, the Tippoo orders the prisoners executed by his personal bodyguard, the fearsome Jettis, but Hakeswill is spared as he reveals Lawford's true rank and that, given that officers rarely desert, Sharpe and the lieutenant are spies. The two are captured and Sharpe is tortured until Lawford reveals their mission. Gudin then tells them that the spy they sought in the city had been killed weeks before and fed to the Tippoo's pet tigers. They are then imprisoned with McCandless and Hakeswill as the British army prepares to attack the city by attempting to breach the booby trapped wall. During their imprisonment, Lawford and McCandless teach Sharpe to read in order that he may be a more effective sergeant.
After days of bombardment, the British finally breach the wall and prepare to attack. With the assault imminent, Appah Rao orders Kunwar Singh to release McCandless, so that the colonel may prevent the British looting his home, whilst the Tippoo orders Sharpe, Lawford and McCandless executed as a sacrifice. Mary joins Singh as he sets out to release McCandless and helps Sharpe escape by providing him a pistol which he uses to kill the tiger guarding them. Sharpe then swiftly defeats the Jettis sent to kill them as he, Lawford and McCandless escape, though they leave Hakeswill in the cells. Lawford and Sharpe then sabotage the mine by setting it off prematurely and capture Gudin in the process. With the early detonation of the mine, Rao decides to abandon the Tippoo and withdraws him men from the battle resulting in the fight swinging decisively towards the British. Leaving Lawford with Gudin, Sharpe returns to Hakeswill and throws him to the Tippoo's tigers, hoping they will eat the sergeant. He then hunts down the Tippoo, who was fleeing the city, and kills him before looting his corpse. But in recognition of the Tippoo's undoubted bravery, Sharpe refrains from taking the enormous ruby adorning his turban, and salutes the dying man in his last moments.
The British take control of the city and install the Rajah as ruler, though very much as a British puppet. Hakeswill survives the encounter with the tigers since they had been fed prior to the battle and so wouldn't eat him. Sharpe, who has now been promoted to the rank of sergeant, refuses to take credit for killing the Tippoo since he would most likely be robbed of the jewels he took from the dead sultan if he admits to being the one who killed him. Despite his denial, McCandless suspects that Sharpe was the one who killed the Tippoo but does not pursue the subject, instead offering Sharpe the chance to work with him again as they watch the Tippoo's funeral.