The Sheriff has turned Locksley into a garrison town, throwing its people out to make room for an army of vicious mercenaries. Robin and the outlaws witness the arrival of the army and steal their food wagon. While they are stashing it in their store, they are intercepted by three burly King's Guards, led by the fearsome Legrand who brings a vital message from King Richard. It turns out to be not a message, but a picture - a clue leading to the "thesaurus patriae" (treasure of the nation). The clue baffles the gang, and while they are trying to figure it out Marian arrives to talk to Robin. She informs him that Allan told Gisborne where to find the stolen food. She asks him to help the people of Locksley and steal the food back, but Robin refuses to, knowing that his mission from the King is more important and must be completed first. At his request, Marian promises Robin that she won't help the people of Locksley on her own as it would be too dangerous, but she still plans to anyway as the Nightwatchman.
In Locksley, Gisbourne and Alan are ready for trouble, and Marian finds herself cornered, and then finally unmasked by Gisbourne. Her secret is out, and Gisbourne swears to her she will die as punishment for her treachery, before walking out and leaving Marian alone with Allan. Marian begs Alan for his help, but he refuses to help her, saying that he has already risked enough for her. Marian is then taken back to the castle to await execution. Gisbourne tells her how she hurt him, and how she deserved what was coming to her.
Meanwhile, Robin and the gang follow the clues to a cave in the forest where they find yet another map. On first glance Robin thinks it shows Kirklees Abbey and he says it out loud, when the Sheriff interrupts. He 'thanks' the gang for letting him know where the treasure is, then drops the heavy stone slab over the entrance, trapping the outlaws inside.Back outside the Sheriff kills the source of all his information - Paxton, the King's contact. Fortunately, with the help of Little John the gang all escape safely. They make their way to the location of the treasure, which turns out to be the king's mother, Queen Eleanor of Aquitaine. Just as they are introducing themselves to Her Royal Highness, the Sheriff and the army of mercenaries arrive, surrounding them. Luckily, there is an escape route - a trapdoor. The gang and Queen Eleanor escape through the trapdoor and find themselves in the forest only to be surrounded once again by the Sheriff and the army of mercenaries. Everyone escapes unscathed apart from Legrand, who is fatally stabbed by the Sheriff whilst trying to defend the Queen.
Back at the castle, Marian attempts to escape her cell by starting a fire to distract Gisborne so she can escape. The plot fails and Marian realises that she will not escape. She resigns herself to her fate and calmly sits to await it.
The Sheriff receives news that the Nightwatchman has been caught and returns to the castle in high spirits to witness the execution, unaware of the Nightwatchman's real identity. As Marian enters the courtyard, calmly prepared to die, somebody appears on the battlements dressed as the Nightwatchman. The imposter Nightwatchman flees the castle pursued by guards who fail to catch him, as he has hidden in a well. The figure reappears and takes off his mask - it was in fact Alan. In a moment of fury, the Sheriff turns on Gisborne, batters him to the ground and threatens him as Marian guiltily watches. The furious Sheriff warns Gisborne that if he makes another incompetent mistake, it will be his last, and storms off, glowering at him and Marian. Gisborne retreats past Marian into the castle.
Back in the forest the gang send Queen Eleanor on her way with the remaining members of the King's guard. Before leaving she gives the gang a bag of gold to help the poor. They thank her, and send her on her way.
Meanwhile, in Nottingham Castle, Guy and Allan go to find Marian in her room. Guy tells her that she was the only thing that made life in the castle bearable, and that he planned to burn the Nightwatchman costume to get rid of the Nightwatchman once and for all. Marian thanks them and hugs them both. To return the favour, Guy asks Marian to stay in the castle. She accepts, and all is well.