The Egyptian god of chaos, Apep, is released from his imprisonment in the Great Pyramid of Giza by a Navy veteran visiting a museum exhibit, whose body he subsequently possesses. The Librarians track him to the Boston Science Museum, where he uses an old submarine to open a pathway to an ancient shrine that prevents the realms of evil and chaos from overtaking the world. When the group tries to stop him from unlocking the shrine, he uses his powers to turn them against each other, which they counteract by singing in harmony. Shortly thereafter, agents of an anti-magic government division, DOSA, arrive and place the Librarians under arrest. Apep subdues them with his power when they make contact with him, allowing the group to escape while the veteran, who has no memories of his actions as Apep, is taken away to be interrogated by the head of DOSA, Cynthia Rockwell
Baird gives Rockwell access to the Library in return for allowing her team to go free. She also acquires intelligence on the location of a mystical dreamcatcher within Mount Rushmore, which turns out to be a diversion planted by DOSA so that they can weaken the Library’s defenses. Baird leads them to the treasure vault, where Rockwell turns Jenkins to stone using Medusa’s head. Flynn sends the group to rescue him while he works to sabotage DOSA’s efforts. They free him, but Apep soon escapes from Rockwell’s custody and takes control of her body. Baird reveals that she and Flynn have been playing Apep from the beginning in order to vanquish him with the Eye of Ra. Apep detonates a bomb of pure evil inside the Library’s catacombs and assumes a spectral form. Flynn uses the Eye to absorb Apep’s power while Stone, Cassandra, and Ezekiel use their gifts to render him, mortal, causing him to be consumed as the Eye’s sacrifice. Rockwell agrees to return all of the artifacts to the Library and the Librarians resume their normal duties.