Doña Louisa Vivar, whom Sharpe befriended in Sharpe's Rifles , visits the Sharpe farm and asks the former rifleman to sail to Chile in search of her husband, Don Blas Vivar, who has disappeared while serving as Captain-General of the rebellious colony and may have fallen victim to his political rival and successor, Miguel Bautista. Sharpe and Harper are travelling to Chile with Spanish Colonel Ruiz and his regimental officers aboard the frigate Espiritu Santo commanded by Captain Ardiles. The group decide to stop off en route at St. Helena to pay a visit to exiled French emperor Napoleon Bonaparte. Napoleon grants an audience but quickly dismisses the Spaniards asking only Sharpe and Harper to remain. Napoleon then beguiles Sharpe into taking a gift to an admirer in Chile for him.
British Consul George Blair welcomes Sharpe and Harper to the Chilean port of Valdivia and informs them that Don Blas's body was recovered and buried three months previously. Sharpe and Harper visit Bautista's adjunct, Captain Marquinez, to arrange passes and permits to travel to Puerto Crucero, exhume the body and return it to Spain. Back at their lodgings they interrupt burglars who wound Harper and escape with loot, including Napoleon's gift.
Sharpe and Harper have a meeting with Bautista, who announces that he has caught the thieves, whom he has branded on the spot, and returns all the stolen goods except for the gift from Napoleon. Marquinez provides the required passes and permits and rides out with Sharpe and Harper on the first stage of their journey. Overnighting at the "Celestial Fort" they are warned by the garrison commander, Captain Morillo, of a possible ambush by their escort, Sergeant Dregara, and given a local scout called Ferdinand to guide them safely across the hills.
Sharpe and Harper arrive in Puerto Crucero and are welcomed by Major Suarez until Sergeant Dregara catches up and has them arrested. After five days in prison Bautista arrives and accuses the riflemen of espionage. In evidence he reveals a coded message hidden in Napoleon's gift. As punishment the Captain-General has Ferdinand executed, confiscates the riflemen's money and weapons and has them deported back to Europe on board the Espiritu Santo .
Lord Cochrane, a former Royal Navy officer now in service to the Chilean rebels under Bernardo O'Higgins, ambushes the Espiritu Santo and, with the assistance of Sharpe and Harper, capture it, taking Captain Ardiles prisoner. Cochrane rendezvouses with his flagship the O'Higgins , patches up the rapidly sinking Espiritu Santo , loads Major Miller and his marines aboard the crippled ship, and sets sail for a suicidal attack upon the port of Puerto Crucero.
Cochrane and Miller lead the marines ashore, with Sharpe and Harper in tow, and with supporting fire from the O'Higgins capture the citadel from Major Suarez. With the citadel secure, Don Blas's grave is opened to reveal nothing but a dead dog inside. A captured Spanish soldier informs them that Don Blas is being held prisoner in Valdivia and Sharpe reluctantly agrees to join Cochrane's assault on the city.
Despite being massively outnumbered and outgunned, Cochrane's men limp into the harbour, disguised as a wounded Spanish ship, and Sharpe leads an assault on the outlying forts. The sheer audacity of their attack convinces the Spanish that a much larger rebel force is attacking, and the remaining resistance collapses with hardly any loss of life on the rebels' side. Without waiting for reinforcements, Cochrane marches his small forces into the city itself, where Sharpe and Harper kill Dregara. Bautista, seeing that all is lost, shuts himself up in the attic of his palace and commits suicide. Marquinez (Bautista's lover), is about to do the same, but Sharpe and Harper stop him.
Realising that Don Blas is not a prisoner in Valdivia, Sharpe confronts Cochrane, who admits that he has been holding Don Blas prisoner all the time. Cochrane is organizing a plot to rescue Napoleon from St. Helena, and plans to offer him a newly liberated Chile as his new base of operations. He duped Sharpe because he needed his help in liberating Valdivia and finding Napoleon's message.
Cochrane releases Don Blas, unhurt, but holds him, Sharpe, and Harper incommunicado until the rescue ship has set sail. When they are released, the three men return to St. Helena, but are stunned to hear that Napoleon is already dead. Sharpe, immensely relieved that Napoleon will never start another war, prepares to return home for good.