The HMS Petrel is bound from the Caribbean to England. Captain Dundas receives a report that a pirate ship has been spotted on an intercept course. When he realizes that they can't outrun their pursuer, Dundas orders his crew to turn and fight.
In a cabin belowdecks, Frederick Nightingale is studying his creation, the Longitude Chronometer.
In the sick bay, ship's surgeon Tom Lowe is operating on an injured sailor, Mr. Gadd. Attending is the surgeon's assistant, Tim Fletch. The pirates manage to board the Petrel and Lowe hears the sounds of battle. He tells Tim to finish up and then goes above decks and fights his way through the pirates. Leading the attackers is Charles rider and Nenna Ajanlekoko. They slaughter any Englishmen they come across and the other crew are soon dead as well.
Tom makes his way to Nightingale's quarters and convinces Nightingale to open the door. Once the man does so, Tom shoots the Chronometer into pieces and then sets Nightingale's logbook on fire. When Nightingale wonders what he's doing, Tom tells him that the pirates will torture him for knowledge of the Chronometer. He then feeds nightingale him a vial filled with poison. Nenna and Rider storm in and Tom immediately surrenders. He identifies himself as the ship's surgeon and says that Nightingale is dying, but offers to save him in return for his life.
Eight Weeks Earlier
Tom returns to Port Royal after finishing his last assignment and meets with his superior, Governor-General William Jagger. Jagger tells him that the Crown has commissioned the creation of the Longitude Chronometer, a navigational device that allows any ship to calculate its exact position on the oceans. Nightingale is taking the Chronometer to London aboard the Petrel, along with his encrypted logbook. Jagger assigns Tom to travel aboard the Petrel as ship's surgeon, but his job is not to protect the Chronometer. His real mission is to kill the pirate Edward Teach, better known as Blackbeard. When Tom points out that Blackbeard is dead and Jagger killed him, Jagger admits that he may have been mistaken. The governor believes that Blackbeard is now operating from a secret pirate's town somewhere in the Caribbean, but that he will emerge from hiding to take the Chronometer. When he does, Tom is to kill him. Tom agrees to the mission and leaves.
The pirates sail the captured Petrel to New Providence, Blackbeard's pirate republic known as the Devil's Dominion. When they take the captive Tom and Tim to shore, Blackbeard's quartermaster Kate Balfour is inventorying the ship's cargo. She notices Tom, who introduces himself and offers his services to Blackbeard in whatever capacity he can. When Tom says that he has no particular interest in right or wrong. Kate tells him that he's on the right island and goes about her business. Tim is shocked at her forward manner and Tom tells him that Kate is Lady Katherine Balfour, wanted in England for high treason.
Rider and Nenna meet with Blackbeard's assistant, Selima El Sharad. They tell her that the Chronometer is destroyed and Nightingale is on deaths' door, but give her the remains of the encrypted logbook.
Meanwhile, the pirates bring Tom and Tim to Blackbeard's quarters in his luxurious manor. Blackbeard cuts another prisoner's throat by way of introduction, but Tom grabs a gun from one of the guards, dumps the gunpowder on the throat wound, and sets it afire with a candle. The burning gunpowder cauterizes the wound and Blackbeard, impressed, introduces himself. He explains that he prefers to be known simply as the Commodore to maintain the secret that he is still alive. Blackbeard and Tom discuss the merits of God and the pirate commodore says that the English are the Devil. He assures Tom that he is the duly appointed representative of the citizens of New Providence, until they choose otherwise. He then raises the topic of Nightingale, saying that he needs him alive and that it's Tom's new job to save him. Tom, unimpressed, says that he doesn't fear death, and Blackbeard chokes him and says that if he fails then death will be the least of his problems.
In Port Royal, Jagger hangs one of Blackbeard's crew by the neck and leaves him dangling on his toes. His assistant brings word that Blackbeard's men have captured the Petrel. The governor demands to know where he can find Blackbeard and points out that the pirate has no reason to protect his master. When the prisoner still refuses to speak, Jagger guts him with a knife.
On New Providence, Rider and his men lock Tom and Tim up in a cell with the dying Nightingale. Tom tells his former assistant that he is not what he claimed, and that he has to destroy the remains of the logbook before Blackbeard deciphers it.
That night, Selima informs Blackbeard that she can decipher the logbook, but that doing so could bring the English fleet down on them. Blackbeard explains that once they have a working Chronometer, they can out sail any fleet sent against them. When Selima hints that she might not cooperate, Blackbeard says that he knows enough about her to know that she can't resist a challenge. The pirate commodore returns to his quarters but hears a noise outside on the balcony. When he throws the doors open, he's shocked to see a ghostly woman in white, her eyes bleeding, standing in front of him. Blackbeard backs away in terror, his nose bleeding, and the woman disappears.
The next day, Tom is glancing out the window of his cell and sees Kate swimming nude in the harbor. Kate goes to her quarters at the quartermaster's warehouse and a man in a wheelchair, James Balfour, welcomes her back.
Later, Tom asks Rider for supplies to tend to Nightingale. The pirate lieutenant reluctantly takes Tom into town and he meets with Kate. He asks for supplies to tend to Nightingale but Kate refuses to do so unless he can pay the 80 pounds necessary. Tom admits that the pirates took everything that he owned and Kate says that she doesn't practice charity.
When Tom returns to his cell, he discovers that Nightingale is dead. He shoves Rider out of the door, grabbing his sword, and barricades the door with Tim's help. As Rider and the others break the door, Tom searches Nightingale's body and finds a piece of cloth with the cipher key written on it. The pirates break in and Tom holds a candle near the cloth, threatening to destroy it. Blackbeard comes in and ask Tom how he plans to buy his safety once he hands over the cipher key. After a moment, Tom burns the cloth and tells Blackbeard that he memorized the key. However, he's willing to betray his king and country to help Blackbeard decrypt the logbook. Amused and impressed in equal measures, Blackbeard compliments Tom by saying he's somewhat of a pirate, and takes him to his manor to proceed with the work. Selima warns Tom that she'll know if he performs a false translation and then leaves with Blackbeard.
Tom works into the evening and Tim wonders why Blackbeard wants the Chronometer. The spy admits that he has no idea and Tim suggests that they burn the logbook and escape. Tom finally admits that his job is to assassinate Blackbeard and deliver the pirate's head to Jagger, and that doing so could be difficult. Rider barges in with his men and Tim ducks into the shadows while the pirates beat Tom to the ground. Selima comes in and suggests that Tom give her the cipher key. He refuses and she has Rider torture Tom for the key, burning his fingers one at a time.
Tim slips out of the room and goes to Blackbeard's quarters. The pirate is entertaining himself with several prostitutes and is surprised that Selima sent a boy to him. When Tim explains why he's there, Blackbeard goes to Tom's quarters and demands to know why Selima is torturing his prisoner. He points out that torture would simply delay the acquisition of the information he wants because Tom would only tell her what she wanted to hear. Chastised, Selima backs down and Blackbeard invites Tom to accompany him. Once they leaves, Rider and his men beat Tim for interfering.
As they stroll along the beach, Tom thanks Blackbeard for his help and the pirate reminds him that Toms' time is limited. They come across Kate walking ashore from her morning swim and she asks Tom if he can swim. He admits that he can if necessary but he doesn't enjoy it. Once she assures Blackbeard that she will soon finish inventorying the Petrel's cargo, Kate goes back to her quarters. James asks her about Tom and realizes that Tom is just as dangerous as Blackbeard. Kate asks how painful his sleep has been, telling James that he cried out in his sleep.
On the beach, Blackbeard tells Tom that if he doesn't fear death or pain, then he will torture Tim and make the world know that Tom is the one responsibility. Tom goes back to his study and finds Tim on the floor. He thanks Tim for saving his life and admits that with their time running out, he'll have to kill Blackbeard that night.
That night, Tom uses the knife from their dinner tray to pick the lock on the barred window. Tim wonders what he's going to do and Tom explains that the things he needs to kill Blackbeard are at the quartermaster's warehouse. He tells Tim to stay put and then slips out onto the balcony. He passes Blackbeard's window and sees the pirate inside, moaning in pain. The spy climbs down from the balcony but a pirate spots him and approaches. Tom kills him, takes his uniform, and dumps him into the ocean.
In the manor, Blackbeard goes to a private room and consults a chart on Chinese acupuncture. He then inserts needles into his skull.
Tom breaks into the warehouse and finds James in Kate's quarters, passed out from smoking opium. The spy moves past him and finds Kate sleeping peacefully. Tom carefully removes the warehouse key from beneath her pillow and breaks into the warehouse. He finds his chest from the Petrel and searches through it... just as Kate comes in, sword drawn, and says that she has the cameo that he's looking for. She holds it up and opens it to reveal a woman's picture, and asks who she is. Tom claims that it's his deceased wife and that he broke in to recover it because it belongs to him. Kate takes pity on him and gives it back to him, and watches as he leaves.
When he gets back to the study, Tom opens a hidden compartment in the cameo and takes out a small of poison. He then goes to Blackbeard's quarters with the logbook and two wine goblets, and is surprised to see Blackbeard with several needles sticking out of his head. The pirate explains that he suffers from headaches and Tom recognizes the symptoms, including the visions. Blackbeard refuses to divulge what visions he suffers from and removes the needles.
In her quarters, Selima gives Nenna a note to deliver to "the Spaniard" and tells her to make sure that no one knows that she sent it.
Tom sets the wine goblets down and tells Blackbeard that he has decided to tell Blackbeard everything that he has learned about the cipher key. As for his fate, he'll trust in Blackbeard's mercy. When Blackbeard asks for the key, Tom shows him a note with the words "Blackbeard must die" on it and says that the English fight their fear of the pirate with black humor. The pirate finds the idea amusing and agrees to share a toast with Tom However, he switches goblets first. Blackbeard then dismisses Tom and says that they'll speak further of his future once he confirms that the key works. Tom leaves and Blackbeard thumbs through the logbook, licking his fingers to turn the pages. Meanwhile, Tom returns to his study, remembering how he used the poison from the cameo on the pages of the logbook.
Once Tom collects Tim, they head for the ocean where a rowboat is waiting. However, they see Nenna meeting with the Spaniard, and Tom recognizes Alonzo Dalvardo, right-hand man to the Viceroy of New Spain. The spy realizes that someone in New Providence is making a deal with the Spaniards against the British, and they can't leave without learning what is going on... and that Blackbeard is the only one who can help Tom find the truth.
Selima goes to Blackbeard's quarters and finds him dying on the floor.
Tom and Tim return to the study and Tom takes the antidote out of the cameo. They break down the locked door and head down the hallway.
The dying Blackbeard mutters Tom's name, and Selima tells Rider to find the Englishman and kill him. He heads to the study just as Tom and Tim come down the hallway. Tom knocks Rider out and fights his way past the pirates, entering Blackbeard's quarters and locking the door behind him. Selima draws two guns and Tom claims that Blackbeard has the falling sickness and has the cure. Unconcerned, Selima shoots Tom in the shoulder, but he manages to yank one of the guns out of her hand. As rider and his men break down the door, Tom holds the gun to Blackbeard's head and tells them to stand down. They hesitate and Tom gives Blackbeard the cure just in time.
The next day, Tom is walking along the shore. He sees Kate in the ocean and swims out to meet her.
Blackbeard meets with James at the warehouse and shows him the shattered pieces of the Chronometer. James stands up from his wheelchair and says that he can fix it given time, and asks about Tom. Blackbeard admits that he's not sure about his prisoner, but that he was the only one to fight to save him when the others were content to avenge Blackbeard's death. As the two men talk, Blackbeard watches Tom and Kate swimming together in the harbor.