In the opening scene, Captain James T. Kirk (Chris Pine) is meeting with the Teenaxi people to make a treaty between them and their enemies, the Fenopians. Kirk is holding an artifact that he claims is a gift of peace from the Fenopians, but the Teenaxi leader considers this a threat. He rolls down to confront Kirk, where we see that the leader and the rest of his people are small creatures. However, they gang up on Kirk and attack him. Kirk calls for Scotty (Simon Pegg) to beam him back up to the USS Enterprise. Kirk records a log, stating that they are now about three years into their five-year mission to explore the ends of the universe. Kirk has become rather bored by this point, and he wonders what else there is to see out there.
Kirk is joined by Dr. Leonard McCoy (Karl Urban) with a bottle of scotch that he took out of Mr. Chekov's (Anton Yelchin) locker. Bones notes that Kirk's birthday is coming up, which Kirk isn't looking forward to since it reminds him of how his father died on the same day, and how Kirk will be a year older than his father when he died. Bones states that Kirk has spent all this time figuring out who his father was in his life, and now he is wondering what it means to be Kirk himself. The crew descends onto Starbase Yorktown to replenish their supplies. Spock (Zachary Quinto) and Uhura (Zoe Saldana) appear to be going through a rough patch in their relationship. She is ready to hand him back a necklace that he gave her, but he refuses to take it back. Mr. Sulu (John Cho) reunites with his life partner and their daughter. Spock is then called aside by two Vulcans ambassadors. He is informed that his older self from the prime timeline, Ambassador Spock, has died.
Meanwhile, a distress signal is picked up by the Federation from an alien named Kalara (Lydia Wilson), who claims to have been part of a crew whose ship suffered a critical malfunction. She asks for help in rescuing her crew on the far side of the nebula. Kirk meets with Commodore Paris (Shohreh Aghdashloo) to apply for a position as Vice Admiral. He requests that Spock be made captain of the Enterprise in his place.
The Enterprise sets off on the rescue mission. As they proceed through the nebula, they approach a Class M planet, and are suddenly attacked by a massive cluster of ships that move like a swarm of insects. The swarm quickly causes heavy damage to the Enterprise, the aliens riding the small ships breaching the hull in a matter of minutes. The crew tries fighting back, but their weapons are not strong enough, and when Sulu tries to warp them out of there, Scotty reports that the ship's nacelles have been sheered off by the enemy. The aliens then allow their leader, Krall (Idris Elba), to board the ship. His soldiers find the artifact that Kirk possessed earlier, a bioweapon called the Abronath. However, when Krall tries to get his hands on it, he finds that its container is empty. With the damage to the Enterprise critical, Kirk orders a general evacuation. Spock and Bones get in an escape pod that heads down to the planet. Krall battles with Kirk, winning the upper hand until Uhura separates the saucer from the engineering section of the ship, taking Krall with her. Kirk then goes with Chekov and Kalara as they make their escape. As the escape pod is ejected, Kirk watches the Enterprise crash to the ground.
Meanwhile, Scotty's escape pod nearly flies into a vast canyon, but he jumps out in time. He is cornered in the forest by the planet's savage inhabitants. Before they can attack him, a scavenger named Jaylah (Sofia Boutella) shows up and beats the savages. Scotty introduces himself to her as an engineer. They agree to work together, with Scotty helping repair something of Jaylah's, and she will help him find the rest of the crew. Jaylah takes Scotty to her home, which happens to be a long-lost Federation starship, the USS Franklin. Spock and Bones have also crash-landed, with Spock impaled by a chunk of metal in his abdomen. Bones manages to pull out the metal and stop the bleeding. The two navigate the area, but they must slow down since Spock is still badly wounded. As they sit down, Spock informs Bones about Ambassador Spock's death. He feels that he must continue carrying out his older self's work on New Vulcan, and he wanted to inform Kirk, but Bones says he probably would not like that.
After landing on the planet, Kirk confronts Kalara, thinking she knew what was coming. She defends herself, saying this was to help save her crew. With Chekov, they rush to find the Abronath on the saucer. Kalara then turns on Kirk, confirming she led them to a trap and that she was working with Krall the whole time. She finds that the Abronath is not where Kirk claimed to have left it. Moments later, the three are ambushed by drones. Kirk and Chekov manage to activate the saucer's thrusters, which lift the saucer high enough until it crashes down hard, killing Kalara. Krall captures Uhura, along with Sulu and the rest of the crew. He and his soldiers take them to his base of operations. It is shown that Krall is able to drain people of their lifeforce to rejuvenate himself, as well as change his appearance. He threatens to kill Sulu for the Abronath, but an Ensign named Syl gives up the weapon, having kept it hidden in the back of her head. He brings Uhura and Syl into a chamber where he demonstrates the use of the weapon. He locks Syl in the chamber and activates the Abronath, releasing a black cloud that envelopes Syl causing her to decompose. Krall intends to use this against the Federation.
Kirk and Chekov run into a perimeter trap that Jaylah has arranged, encasing them in a crystallized shell. Scotty and Jaylah find them, and she breaks them free when Scotty says they are part of his crew. They team up to rescue the rest of the crew. Scotty repairs the Franklin's transporter pad to teleport people onto the ship. They start with Spock and Bones, who are about to be killed by more drones until they are both beamed onto the Franklin. On the computer, they receive a signal on Uhura's location since the necklace Spock gave her is also a tracking device. They see she is with the rest of the crew at Krall's hideout, but Chekov says they are unable to beam everyone up from there. Kirk figures they need to head in there and come up with their own rescue plan. Jaylah wants no part since she knows people who go near Krall's camp never come back alive. Her father fought Krall's right-hand man Manas and was killed. Scotty says she is not alone and can work with the others to save the crew.
Kirk creates a diversion with a motorcycle he found on the Franklin while Spock and Bones sneak around to take a number of crew members at a time onto a pad and use a beacon to beam them onto the Franklin. Krall's men attack, leading to Jaylah fighting Manas one-on-one. Kirk protects the crew by spreading the crystallizing material to shield them from Krall's army. As the rest of the crew is saved, only Kirk and Jaylah remain. Jaylah pushes Manas off the pad to his death and jumps to reach Kirk as he activates his beacon, sending them back to the Franklin. Krall and his army fly toward Yorktown so he can activate the Abronath and kill everyone. The Enterprise crew follows. Spock and Bones beam onto a drone ship and figure out that they need to use a distraction to get by the other drones. Scotty uses Jaylah's music system to create discordant noise with The Beastie Boys' song "Sabotage". The drones are obliterated, leaving only Krall's ship plus two others. The Franklin manages to stop Krall's ship, causing her to crash into a fountain.
The crew goes off to find Krall and make sure he is dead. They find two dead bodies drained of their lifeforce. As they continue making their way, they notice a video of the original crew of the Franklin from a century ago. Uhura spots a familiar face among everyone else. The man she sees is Balthazar Edison, the captain of the Franklin, but he is now Krall. Kirk asks to see Edison's old logs, skipping to the last one to see Edison having become jaded and angry with the Federation after his ship was stranded with no help, following his crew's own series of missions. Edison mentioned discovering a life-sustaining force that he intended to use to keep himself alive. A major in the United Earth Military Assault Command Operations (MACO), he became disillusioned with the Federation, rejecting its principles of unity and cooperation with former enemies.
Now looking slightly more like his former self, Krall takes the Abronath to Yorktown's life support hub, which would allow the black cloud to spread through the entire starbase. Kirk finds Krall and starts fighting him to take the Abronath away from him. Kirk tries to reason with Krall, but he is no longer the same captain he once was. Kirk's crew attempts to open the doors into space to pull out Krall. Krall activates the Abronath, which starts releasing the black cloud. However, Kirk avoids getting killed and pushes Krall into the path of the cloud. The doors open and sucks Krall into space with the Abronath, where he is consumed by the cloud and is thus disintegrated. Kirk gets pulled out as well, but Spock and Bones fly in and pull him to safety.
In the aftermath, Commodore Paris closes the unsolved cases of the fate of Captain Edison and the USS Franklin crew. She also offers Kirk the position of Vice Admiral, but he chooses to remain a captain since he prefers to fly. Meanwhile, Spock goes through Ambassador Spock's old materials. Among them is a picture of the Enterprise crew in the prime timeline right before they retired. Bones then brings Kirk to a surprise birthday party with the whole crew there to celebrate. Spock and Uhura reconcile their relationship. Kirk and Scotty pull some strings and get Jaylah into Starfleet Academy. The main crew then sees the USS Enterprise-A is being built. With that, the crew recites the original final frontier monologue as they resume their mission.
The film closes with the words "In loving memory of Leonard Nimoy" (who had passed away in 2015) and "For Anton", a dedication to Anton Yelchin who passed away shortly before the film's premiere in 2016.