As the book opens the Admiralty is debating on how to reward the captains who captured the Spanish gold ships. Since Spain was not at war the prizes are not considered real prizes and the captains end up with smaller bounties than they thought they would receive. In the same meeting the new First Lord of the Admiralty mentions Stephen's name even though it is in a classified folder, blowing his cover as a spy.
Stephen willingly goes on a mission to Spain anyway, and is to be picked up by Jack while he is guiding HMS Lively on a return journey to English waters. Stephen has been captured and is being tortured by French intelligence when Jack gets to Port Mahon. A Catalan revolutionary gives Jack Stephen's location, to which Jack leads a party rescuing Stephen and killing the French interrogators.
Upon returning to England Jack finds that the fortunes he had expected from the Spanish gold fleet were not as large as he had hoped and he is still in debt. Jack is soon taken by bailiffs and is held in a sponging house. Stephen returns to Sir Joseph and tells of his capture and Jack’s predicament. By pulling a few strings, an advance is given to Jack on his prize money which gets him clear of the debt he is currently being held on, but not all of his debt.
Ever since Jack had fled the country for debt, Mrs. Williams had forbidden Sophie to talk to him. He believes that she is interested in marrying an Anglican priest, but after meeting with Sophie, Stephen convinces her to go see Jack secretly before he takes command of his new ship HMS Surprise. Jack and Sophie meet in a coach in the middle of the night, and promise to marry no one else.
Stephen and Jack leave in the Surprise to ferry an ambassador to the East Indies. Upon getting underway, half of the crew become sick with scurvy and the ship is forced to put into Brazil to receive fresh fruit.
As the journey continues the Surprise makes a wide turn around the horn of Africa, at the time held by the Dutch who are at war with England. To avoid encounters, Surprise navigates into the waters of the Antarctic Ocean and has to weather a severe storm. The ambassador at this time becomes very ill. The Surprise puts into India to refit from the storm and to rest the ambassador. While ashore Stephen meets a local girl named Dil who shows him around India. While watching a parade with Dil Stephen runs into Diana, who had moved with Canning to India. They spend several days together and Stephen asks her to marry him. She doesn’t answer him before he has to leave.
The ambassador dies east of India and the Surprise turns around and sets sail for home. They run into the East Indian Company's China Fleet on return for England, but unescorted. A day after leaving the China Fleet the Surprise spots a French Squadron cruising the Indian Ocean. Surprise engages the smallest sloop of the squadron, knocking about her sails, then turns and makes speed back to the fleet of merchantmen to warn them and organize a defence.
Choosing the largest ships of the China Fleet, Jack dresses them as Men-of-War and sends some of his officers to help them fight. The French squadron closes on the Surprise and the large Indiamen. The Surprise turns and engages the largest French warship, the 74-gun ship of the line Marengo, and is exchanging broadsides with the heavier ship when one of the Indiamen is able to engage the French ship from the other side, forcing her to disengage and the entire French squadron is forced to flee to refit.
Jack is the toast of the merchants. He is awarded money and prizes. He is allowed to transport gold — a high honor — and he receives a cut of the profit. While in India, Canning confronts Stephen and they challenge each other to a duel. During the duel Canning shoots Stephen in the ribs, but Stephen hits Canning in the heart. Stephen convinces Diana to return with him, though on a merchant ship instead of Surprise; Jack will hear nothing of it. Meanwhile, Stephen is running a high fever because the bullet is still lodged in his ribs. With the help of Jack and the ambassador’s surgeon, Stephen operates on himself, removing the bullet(this was used in the movie Master and Commander The Far Side of the World).
As the Surprise sails home they stop at an Atlantic outpost and there Stephen finds that Diana has left him for a Mr. Johnson from America. Jack on the other hand had sent ahead for Sophie so that he may marry her now that he is out of debt, but she is not on the island. Within a day’s sailing Jack overtakes an English frigate in the night and finds that Sophie is aboard. She refuses to marry him then but promises once they return to England that she will.