This third 'Maze Runner' film opens some time after the 'Scorch Trials' film with the Gladers chasing after a WCKD train to rescue Minho (Ki Hong Lee) and other captured children. Thomas (Dylan O'Brien) and Vince (Barry Pepper) attempt to board the train while Jorge (Giancarlo Esposito) and Brenda (Rosa Salazar) fend off WCKD mercenaries. Thomas and Vince hop on and separate the cart with the captives away from the main train. When the villains realize what happened, they try to run back to kill the Gladers. Fortunately, Newt (Thomas Brodie-Sangster) and some members of The Right Hand were hiding nearby, and they hijack a WCKD jet and manage to carry the cart off the train and back to their hideout.
Upon arriving at the hideout, Thomas discovers that Minho isn't with the ones they rescued as he had believed. Newt and Frypan opt to go with Thomas to go find him, even though Vince and Jorge want everyone to stay together.
Janson (Aiden Gillen) finds Minho at the train site. When they bring him back to WCKD headquarters, Minho is put in a virtual reality simulation where he finds himself in the same maze he started in. He runs through it and finds himself being chased by a Griever. Minho is cornered by the Griever in the simulation while WCKD scientists are extracting his blood for finding a cure for the Flare virus. Overseeing all of this is Ava (Patricia Clarkson) and Teresa (Kaya Scodelario), the latter who feels remorse for betraying Thomas and the others at the end of the previous film.
Meanwhile, Thomas, Newt, and Frypan drive through a tunnel past an infection checkpoint where they encounter Cranks. Their car flips over and nearly traps them, but Frypan emerges with a rifle to start shooting at the Cranks before they can attack. An even larger number of Cranks approach before the guys are saved by Jorge and Brenda. They proceed toward the Last City until they notice it is guarded by a massive wall to keep the infected out.
Ava and Teresa meet with WCKD board members to discuss the matter of the wall and their progress in creating a serum for the virus. Ava requests that they allow her and the scientists to begin performing trials. Despite their hesitation, Teresa steps in and gives good reasoning for going ahead with the trials.
The group arrives outside the city to see a crowd of infected protesters gathered by the wall. Within moments, guards start to fire upon the protesters using enormous blasters. Thomas and his friends run from the chaos and are taken by masked men. After being brought to a safe spot, Jorge starts beating one of the masked men. The man reveals himself to be Gally (Will Poulter), previously thought to have been dead. Thomas punches him in the face as payback for Gally killing Chuck. Gally apologizes for what he did as he had been infected at the time. He offers the group a chance to help them.
Gally leads the group to the home of an infected rebellion leader named Lawrence (Walton Goggins), whose face is disfigured as a result of the virus. Lawrence offers Thomas a way to sneak into the city on the condition that he helps him out as well. Thomas agrees and travels through a secret passage with Newt and Gally while the others stay behind.
At a lab, Teresa tests out Minho's blood on a young infected girl named Cheyenne (Shai Lun Choo). Teresa then goes to Minho's cell to tell him what she's doing. He pulls her in and attacks her for being a traitor before guards come in to sedate him. Teresa goes back to find that Cheyenne's condition has worsened, as she is now in a Crank-like state.
At the hideout, Gally shows Thomas and Newt that their only way into the WCKD facility is through Teresa. Thomas is hesitant in going through with it, which Newt thinks is because Thomas still has feelings for Teresa. Newt gets angry with Thomas until he gets calmed down. Outside, Newt reveals to Thomas that he got infected in the tunnels, but he doesn't want anyone else to know about it just yet.
Thomas manages to get Teresa to spot him on the streets, leading her to follow him into an alley where Gally captures her. She is brought before the group to convince her that they need to get inside the facility, and Teresa says they need her fingerprint.
Thomas, Newt, Gally, and Teresa all head toward the facility. Gally goes to find a serum and the immune children while the others go look for Minho. They find and finally free him, and they head to escape, but are found by Janson and several guards. Teresa helps the guys escape while she stays behind. Newt finds the children and frees them, with Gally guiding them outside after finding the serum. The children head toward a bus with Brenda. Frypan helps pull the bus away with a crane, but it becomes too heavy and falls away from WCKD. Thomas, Newt, and Minho are forced to jump out a window and into a pool to get away from Janson.
Lawrence gathers his army of infected people as they head to take the city back. Lawrence rides a van with explosives into the side of the wall, causing a huge explosion that allows the army to storm in. Soon, the whole city is under siege. Meanwhile, Newt starts to get worse, turning more into a Crank. He gives Thomas a necklace with a cylinder before he passes out. Teresa broadcasts her voice over the speakers to call to Thomas, saying they need his blood for the cure since it was his blood that helped cure Brenda when she was sick. Moments later, Newt reawakens in a Crank-like state, begging Thomas to kill him as he starts to attack. Thomas defends himself against Newt until he is forced to put a knife in Newt's heart. Newt dies, and the others gather around him as Thomas heads back to WCKD with great remorse.
Thomas finds Ava, and he aims his gun at her. She attempts to help him, only to get shot dead by Janson. He takes Thomas to a room where Teresa is preparing to extract his blood. When Janson says that WCKD will only cure those they deem fit, Teresa whacks him over the head, and she tries to help Thomas get out. Thomas then starts to fight Janson. Before Janson can finish them, Thomas throws a weight at a cell door holding two Cranks. They break out and start to maul Janson to death. Thomas and Teresa head to the top of the building, but Thomas was just shot by Janson. Jorge rides a jet to the top with Brenda, Vince, and Gally. Teresa helps Thomas jump to safety. Before she can go, the building next to the facility collapses in the chaos of the rebellion. The adjacent building comes down on WCKD, causing it to crumble and collapse, taking Teresa with it. Thomas looks on in sadness as he watches her fall to her death.
A while later, the survivors have made it to an island, a safe haven that Ava had mentioned. They make it their new home. Minho gives Thomas the necklace that Newt gave him earlier. Inside is a note from Newt to Thomas, reflecting on their entire ordeal and thanking him for being a friend, but also requesting that he takes care of himself and everyone else. The survivors then start to carve the names of their lost loved ones onto a rock. Thomas carves the names of Chuck, Newt, and Teresa.
The final shot shows Thomas walking along the beach alone, holding the serum in his hands as he looks out into the distance.