Protagonist Thomas is held in solitary confinement, but is eventually released by Assistant Director Janson who tells the Gladers and Group B that there is a cure for the Flare (a deadly disease). Many of those present were immune to the Flare while some, including Newt, were not, and escaping would serve no purpose, for people in the outside world despise the Immunes. The Gladers are offered the chance to restore their memories and remove the controllers in their heads. Without the devices, Thomas, Teresa, and Aris will no longer be able to communicate telepathically. Most accept the procedure; Thomas, Minho, and Newt, are later forced into the process, because Janson feels that they will be no help to finding the cure if they don't get their memories back. All three of them escape with the help of Brenda and Jorge, who are revealed to be working for WICKED, and were sent to the Scorch as an assignment. Thomas feels betrayed, but Brenda convinces him that she had no choice and that most of her behavior was not a deception. Soon afterward, the Gladers discover that everyone who had undergone the restoration procedure had abandoned them, and Newt begins to succumb to the Flare, suffering sharp mood swings. Newt gives Thomas a note and tells him to open it 'when the time is right'.
The four of them then go to Denver looking for a man called Hans who can take out Minho, Thomas and Newt's mind controlling chips, and for several others that also came to Denver. Newt is unable to continue, as he's infected with the Flare, and the rest of the group leave him behind. In the airport, a black suited man directs them to an address. Waiting for them is Gally, who is determined to put an end to the trials and stop the endless futile experiments. He tells them that WICKED is capturing every Immune they can find to prepare another cycle of the Trials. Gally also reveals that the decaying cities are home to many who suffer from the Flare, but partake of a drug call the Bliss, which slows its progression. After meeting Hans, he removes Minho's and Thomas's control chips. Thomas ends up alone after resisting the procedure, and is captured by a man who wants to give him to bounty hunters (who will end up giving him to WICKED); Janson (in a hologram form) uses a police car to rescue Thomas, and tells him that to save Newt, he must return to WICKED. Minho, Thomas, Brenda and Jorge return to the Berg and find a note: Newt has been taken to the Cranks. Minho convinces the four of them to go to the Crank Place in a rescue attempt, and they meet Newt after bribing the guards. Newt tells them to leave, and the Cranks chase them out. Thomas remembers the note Newt gave him -- 'Kill me, Thomas, kill me'. Thomas despairs but the four end up going back to Denver.
At Denver, they discover that Teresa and the other Immunes were all captured. Thomas and Minho knock out the guards and threaten to shoot their toes if they don't take him to their leader. Thomas and Brenda discover that the 'leader' is actually Right Arm's leader, Vince. Vince tells them that they are copying WICKED's design and plan to take over their headquarters building. On his way to the Right Arm's Bergs, Thomas sees Newt with a group of Cranks, taking over Denver. With a pistol in his pocket, Thomas tries to convince Newt to come with him, but Newt begs for death. Thomas is eventually forced to kill him.
Thomas arrives at WICKED's headquarters, and discovers that Janson intends to complete the cure by using Thomas' brain -- an act that will result in his death. Thomas questions his trust in Janson but goes on with Right Arm's plan and plants a device that disables all of WICKED's weapons. Right Arm saves Thomas' life as they storm WICKED headquarters. Thomas finds a note from the Chancellor of WICKED; it reveals that they already have enough resources to build the blueprint for the cure. It also reveals the location of the Immunes Right Arm is using, those that WICKED captured and a 'paradise' where Thomas should take them all. Thomas and Gally re-enter the Maze to find WICKED's captured Immunes. They quickly learn that Right Arm does not intend to occupy WICKED headquarters -- they intend to destroy it. Explosions rock the Maze, killing two hundred Immunes within. The Grievers come out, but Teresa shows Thomas how to defeat them. Returning to the outside world, Thomas is almost trapped by a piece of falling debris on the way to the Flat Trans that would have taken them to the promised 'paradise'. Teresa pulls him out of the way, but dies in Thomas' place.
The epilogue reveals that the Flare was engineered as a form of population control, and WICKED was unable to find a cure. The Chancellor realizes that from the beginning, the Immunes were their only hope; while the world will crumble, the remaining Immunes will rebuild society and restore the human race.