With the Peace of Amiens, Jack Aubrey returns to England and rents a house with Stephen Maturin, with shipmates running the household, spending time in the hunt. He meets the Williams family. Aubrey courts Sophia Williams, the eldest of three daughters, while Maturin pursues Diana Villiers, Sophia's cousin. Aubrey wants to marry Sophia, but she delays making a firm engagement. His fortune abruptly disappears when his prize-agent absconds with his funds and the prize court finds that two merchant ships he captured were owned by neutral nations. The court demands he repay the value of the ships (rather than gain the prize money he expected), a sum beyond his means. Mrs Williams takes her daughters away to Bath on this news. Aubrey dallies with Diana, straining his friendship with Maturin and showing himself indecisive on land, a contrast with his decisive ways at sea. Aubrey and Maturin flee England to avoid Aubrey being taken for debt.
In Toulon to visit Christy Pallière, the French captain who had captured Aubrey's first command Sophie before the peace, they learn that war is imminent. French authorities round up all English subjects. Aubrey and Maturin escape over the Pyrenees to Maturin's property with Maturin disguised as an itinerant bear trainer and Aubrey as the bear, Flora. They make their way to Gibraltar where Aubrey and Maturin take passage aboard a British East India Company ship. The ship is captured by the privateer Bellone , but a British squadron overtakes them and rescues Aubrey, Maturin and the other passengers.
In England, Aubrey is offered a letter of marque by Mr Canning, a wealthy Jewish merchant. At the same gathering at Queeney's, Mrs Williams and Cecilia are among the guests; unaware he would be there, Sophia stayed home with Frances. Mrs Williams learns of Maturin's castle in Spain and his training as a physician, raising his status in her eyes. An inadequate thief approaches Aubrey as he walks outdoors; Mr Scriven proves to be a useful friend, knowing the law of debt and where Aubrey can be safe from bailiffs. He and Maturin move to The Grapes, safe in the Liberty of the Savoy.
Aubrey is given command of HMS Polychrest , so he turns Canning down. Polychrest is an odd ship that was purpose-built to for an experimental weapon now abandoned. He asks that Tom Pullings be promoted to lieutenant. Polychrest is structurally weak and sails poorly, and the first lieutenant, Parker, is free with punishment. Aubrey is given a free hand by Admiral Harte, who stands to benefit personally from any prizes taken. To Harte's disappointment, Aubrey captures no prizes. When he drives the French privateer Bellone aground outside a Spanish port, the merchants reward him. Harte assigns Aubrey to escort convoys in the English Channel. Aubrey gains a reputation for lingering in port as he carries on a furtive affair with Diana. Maturin is sent on an intelligence gathering mission in Spain. On his return, Maturin is advised by Aubrey's friend Heneage Dundas to warn Aubrey about his reputation with the Admiralty. When Maturin does so, Aubrey gets angry and the two agree to fight a duel. Aubrey calls on Diana, but finds her with Canning, ending Aubrey's interest in Diana. Aubrey is ordered to raid the French port of Chaulieu to sink the French troopships and gunboats and to destroy the Fanciulla . The crew plans to mutiny because of their harsh treatment under Parker. Maturin overhears their plans and warns Aubrey. Aubrey quashes the mutiny by putting the instigators and some loyal crew in a ship's boat and then begins the attack on the moment. He rues his angry words with Maturin. During the engagement in Chaulieu, Polychrest runs aground. Aubrey leads three of the ship's boats to board and capture Fanciulla . The successful mariners refloat Polychrest , which founders soon after leaving Chaulieu, and the crew transfer to Fanciulla . After the battle, Aubrey and Maturin resume their friendship.
Aubrey returns to England in Fanciulla and is promoted to Post-captain. Debt still hanging over him, he asks for any command. He is assigned as temporary captain forHMS Lively
whose Captain Hamond, has taken leave to sit in Parliament. Returning from Spain, Maturin tells the head of naval intelligence, Sir Joseph Blaine, that the Spanish will declare war as soon as four ships full of bullion from Montevideo arrive safely in Cadiz. At Maturin's urging, Sophia asks Jack Aubrey to transport her and her sister to the Downs. While on board, Aubrey and Sophia come to an agreement not to marry anyone else; Aubrey is too poor to propose a marriage settlement satisfactory to Mrs Williams. Maturin is close friends with Sophia, but does not take up her advice to propose to Diana. While attending the opera, he sees that Diana is being kept by Canning; his pain is deep.
Maturin takes no pay for his intelligence work, but he does ask a favour: that Lively be included in the squadron sent to intercept the Spanish. The Admiralty agrees, and asks Maturin to negotiate the treasure fleet's surrender. Because of Maturin's temporary rank and his connection to the Admiralty, Aubrey realizes that Maturin has been involved in intelligence work for Britain. Aubrey understands at last that there is a side of his friend that he did not know. The Spanish convoy refuses to surrender, and battle breaks out. One Spanish frigate (the Mercedes ) explodes and the other three ( Fama, Clara, Medea ) surrender. Clara , carrying the treasure, strikes her colours to Lively , greatly pleasing its captain. Then he chases Fama . He invites two of the Spanish captains to dinner, along with Dr Maturin, and they all toast Sophia.