When the book opens Hornblower has just been given a commission as Captain of the seventy-four gun ship Sutherland. He thinks this may be thanks to Lady Barbara Wellesley, with whom he is in love. They had almost become lovers at the end of the voyage in the Lydia, as described in the previous book, but that had ended badly and Barbara has now married Admiral Sir Gilbert Leighton, under whom Hornblower is going to serve.
Hornblower and his wife Maria, who is pregnant, are invited to dinner with Barbara and Leighton. This occasions some awkwardness on Hornblower's part but Barbara is cool and self-possessed. The evening causes a huge turmoil in Hornblower's mind and he is glad when he finally gets to sea, although his ship is seriously under-manned.
The squadron that Admiral Leighton commands is to be stationed off the east of Spain, to help in the blockade of the French fleet and prevent it from supporting the troops on land. Hornblower is ordered to escort a convoy of merchant ships; before parting from them he abducts a lot of men to make up his own number. He then gets permission to go along the Catalan coast alone and look for likely targets to attack. He conducts three very successful operations before rejoining the squadron, when Leighton reprimands him for not keeping in touch sufficiently.
A violent storm nearly sinks Leighton's flagship but Hornblower manages to tow it to safety. After making repairs in harbour Leighton returns and decides to make a surprise attack by land on Rosas, a Spanish port that is held by the French. His plans go awry and only swift action by Hornblower averts a total catastrophe.
Later, Hornblower, once more on his own, encounters four French warships that have escaped the blockade. He sends a message to Leighton to warn him and meanwhile shadows the enemy as they approach Spain, making for Rosas. As the rest of the squadron fails to arrive in time he confronts the French single-handed outside Rosas. He damages two of them so severely that they are effectively out of action, but the Sutherland is totally wrecked and at least half its crew are killed or wounded. One of the wounded is Bush, the first lieutenant of the Sutherland, who loses a foot. Hornblower has no option but to surrender to prevent the death of everyone on board.