Indra, Murphy, and Pike plot their escape. Pike and Murphy are in favor of running once they are freed, while Indra wants to stay and fight, killing their apparent leader, Jaha. When ALIE's chipped soldiers come in to see which prisoners are willing to take the key, ALIE realizes that someone is unchained (because of Pike's wounds).
While the guards are distracted checking everyone, Indra takes them off guard and kills the chipped soldiers. Murphy explains to Indra that perhaps if they destroy Jaha's backpack, they can destroy ALIE. Indra reveals that she saw them stash the backpack. Pike comes up with the idea to for the group of prisoners to flee, distracting ALIE and her army, while the three of them search for and destroy the backpack.
Meanwhile, in the City of Light, ALIE and Jaha realize what has happened and that they are going to find the backpack. ALIE summons Emori and recruits her to stop John Murphy from harming the backpack in Titus' temple.
Clarke, Bellamy, Octavia, and Murphy sit around with Luna's people as they listen to a girl telling a story of a shark attack. When Luna arrives, Bellamy and Clarke try to explain the situation to her, but she refuses to hear it. She tells Bellamy and Clarke that their group will leave that night, when the boats come back.
Luna speaks with Octavia about Lincoln, returning Lincoln's journal to Octavia. Octavia attempts to convince Luna that Lincoln would have wanted her to help them. Luna disagrees; she believes Lincoln understood what she stood for and would never have brought trouble to her oil rig.
Raven and Monty observe ALIE's code. Raven realizes that ALIE is recruiting more and more people. Raven wants to try to enter through a back door code, destroying ALIE on her own without waiting for Clarke and the others. Monty disagrees, telling Raven that they only have one shot and must wait for Clarke to implant the flame in Luna and get the kill code to destroy ALIE.
Harper calls Monty away under the pretense of sealing the airlock. Instead, she brings up the fact that they should spend time in between attacks actually living. She kisses Monty, and they go off privately to have sex, as elsewhere Raven continues her work mapping ALIE's code.
Back on the oil rig, Jasper chats with the girl who was telling the shark story, Shay. Shay grew up on the oil rig and never left it.
Clarke, Bellamy, and Octavia discuss their options. Clarke suggests forcing the flame into Luna against her will. Bellamy and Octavia are against it, but can't come up with any better ideas. Bellamy eventually agrees with Clarke that they won't leave without Luna, though Octavia is still resistant.
At Arkadia, Raven barges in and interrupts Monty and Harper in the midst of the afterglow. She calls them back to the computer room and explains that there is one fortress, a "Citadel," in the City of Light that is heavily guarded. Raven wants to attempt to access it and figure out what she is hiding. Monty convinces her that they need to wait for the others to return with the kill code. Monty offers to help Raven with mapping ALIE's code.
Clarke approaches Luna. They discuss Lexa's death and Clarke becomes emotional, trying to convince Luna that Lexa was working towards peace. Luna continues to deny taking the chip and being made to do violence in the name of saving people.
Clarke activates the flame and attempts to force it on Luna. Luna easily overpowers her, having left the conclave because she knew she would win. She was matched against (and killed) her own brother, before being matched with Lexa (at which point, she fled).
ALIE, Emori, and two guards wait in the temple for Murphy, Indra, and Pike to arrive for the backpack. The three come in through a secret entrance and take our the two guards, with Murphy telling Pike not to harm Emori. Before Murphy can destroy it, Emori tells him it's a nuclear fuel cell and that destroying it will irradiate the entire city.
Luna and her people load Clarke, Bellamy, and Octavia into a storage container to take them to shore. Clarke still tries to convince Luna to accept the flame, but at that point it's revealed that some of Luna's people were chipped when they turn on Luna and attack her.
As Shay and Jasper walk towards the boat together, ALIE's chipped soldiers attack. Jasper instructs Shay to run and warn her people not to take the chip, but ALIE has her soldiers shoot Shay with an arrow, wounding but not killing her. They capture Jasper as well as Luna.
One of Luna's men tortures her, trying to get her to take the chip, as her boyfriend Derrick and Jasper are strung up and watch nearby. Jasper explains what has happened to her people and refuses to accept the chip himself.
In the storage container, Clarke, Bellamy, and Octavia realize what is happening and try ceaselessly to escape. Bellamy realizes that ALIE followed them there, since there was a drone that spotted them at Niylah's.
Derrick takes the chip in exchange for Luna's torturer to stop harming her. Once he takes it, he goes to Luna and begins torturing her instead.
Back in Polis, Pike works on disabling the nuclear fuel cell as Emori continues to tell Murphy they'll all die there. In the City of Light, ALIE tells Jaha that the migration is nearly complete. She mentions that they will need Murphy alive in case Clarke refuses to help them insert the AI into Luna.
At Arkadia, once Monty falls asleep, Raven starts accessing ALIE's code. ALIE realizes what is happening and tells Jaha. Jaha suggests she remove herself from the Ark mainframe. ALIE believes that's unwise because if she does that, the backpack (which is currently compromised) will be the sole power source. Thinking the person accessing her code is Monty, Jaha comes up with the idea to summon Hannah to speak with him.
Hannah talks to Monty, distracting Raven from finishing accessing ALIE's code. Hannah tries to convince Monty to join her in the City of Light. Monty deletes his mother's code, removing her from existence. Jaha tells ALIE to remove herself from Arkadia. As Raven accesses the last door and finds the kill switch, ALIE pulls herself off of the mainframe. Monty gets angry at Raven for not having listened to him and waited for the others -- now the code is gone and they can no longer access the killswitch.
Meanwhile, in Polis, ALIE reaches the last minute needed for the migration to complete and instructs Emori to distract Murphy longer. Emori prevents Murphy from destroying the backpack by telling him that destroying the backpack will destroy all of the minds in the City of Light as well.
Pike destroys the backpack instead, but they are too late -- ALIE's migration is complete and destroying the power source does nothing. Pike, Indra, and Murphy flee. ALIE informs Jaha that the migration was a success and that the transmission from the escape pod was complete -- no one can get to them where they are now, up in space.
Shay manages to reach the storage container and releases Clarke and the others before dying. Derrick continues to torture Luna. ALIE's soldiers threaten the child Luna is close to, in an attempt to force Luna to submit. Instead, Luna breaks free and kills the chipped men, including her own boyfriend, Derrick, after ALIE instructs Derrick to kill Luna so that Clarke can't have her.
Clarke, Bellamy, and Octavia break into the room to find Luna sobbing over Derrick's body, as Clarke looks on, horrified. They release Jasper.
Luna prepares to bury Derrick and the others. Luna toasts her fallen people, as Clarke again attempts to convince Luna that she must accept the flame to defeat ALIE. Suddenly, Octavia and Bellamy collapse, and Clarke realizes that Luna drugged their drinks. The four of them wake up back on shore, with Luna's oil rig nowhere in sight, wondering what to do now.