This book begins with the main character of the book, David, finding out his longtime girlfriend Hilary is cheating on him with one of his teammates from the football team. David's mother died about a year ago and Hilary says he hasn't been the same since and that she can't be with him anymore. David sees his teammate, Sam, at the party he is at and beats him up.
The next day David and his brother Will are starting back to school from their summer vacation in a new school (still the same teachers and students at the school, but a new school has been built). When they go into school part of the school explodes, a giant canopy is dropped over the school and soldiers rush in telling the students they have been quarantined due to a virus carried by an escaped teen from a nearby testing facility that causes anyone very young or old to die when coming into contact with the teenagers. David sees this firsthand when several teachers die due to exposure to the teens.
Life from there pretty much gets worse. Food drops are started by the military and students begin forming groups to try to get the most food and supplies. The groups are as follows: Nerds, Geeks, Freaks, Varsity, Pretty Ones, Sluts, and then there are those who aren't in a group like David called Loners (although they are called Scraps at this point in time).
David begins doing the other students laundry to try to get the necessary supplies for himself and his brother since no group will have them due to David being an arch rival of Sam, now the head of Varsity and a known killer since he recently killed a kid during one of the food drops.
David is out doing his trading for the day when he sees a girl (we later find out her name is Lucy) at the "Graduation Booth" being attacked. This booth is on a release schedule for each student. As they become older the virus gradually fades out of their system and they are scanned at the booth and released into the outside world.
David saves Lucy by attacking Brad, a member of Varsity who is trying to rape her. Brad falls when David punches him and hits his head on the concrete, dying. It seems now Sam will really have it out for David since he killed one of his friends.
We find out Lucy was a member of the Pretty Ones (the group Hilary now runs) but was kicked out because she couldn't be forced to date a member of Varsity, and we also discover that Will knows Lucy from a summer camp the year before and that he is in love with her and has been ever since then. Although Lucy was a member of the Pretty Ones, we find out she has a very kind heart and is not malicious like the rest of that group.
A while later, another Scrap pulls David to the side to try to get him to be their leader. He at first declines but when this group of Scraps rescues him when Sam is about to hang him he agrees to be their group leader. They become the Loners, and live in the school dump area downstairs. Varsity attacks the dump and burns it down, so now the Loners are starving and homeless.
David goes to the next food drop to stand up to Sam with the Loners, although there are only a few of them and almost triple their number in the Varsity group out of desperation for supplies. When one of the Varsity members steps forward and joins the Scraps, several other people do too (totaling about 80 fellow Scraps) and now their group is large enough to even take the food away from Varsity at the drop, who normally takes most of the food pallets. When Sam tries to attack David during the commotion, the Loners all stand up for him and are going to beat Sam to death but David stops them.
Now that they are a larger group, the Loners take over the stairwell and make it their home. All seems to be going well.
Later on in the book, Hilary tries to get David back but David has fallen in love with Lucy and she with him by this point. Hilary is pissed, and when Sam finds out he forces Hilary to attack David and stab him, taking out his eye. The relationship between David and Lucy is a huge rift in he and Will's relationship, but when Hilary attacks David, Will takes off on his own because he feels guilty since he was supposed to be guarding the stairwell the night David was attacked.
After recovering from his wound for a few weeks, David attends the next "Graduation" ceremony to show that he is still strong enough to be a leader and not afraid to come out in the open since one of their own group is graduating. However, at this ceremony the graduation doors don't open and soldiers burst into the school again saying that the exit doors are malfunctioning and they will have to be scanned one by one. A student tries to go through who is not supposed to graduate and all hell breaks loose, causing the soldiers to start shooting and the students to riot. Two soldiers are killed but the rest escape.
As punishment no food drops come anymore, and the students realize the outside world is just going to let them die, so things become even more desperate as people are killed for what little food is left.
Will comes back just in time with news that he has found a dog in the depths under the school and thinks there is a way out. David is beginning to hallucinate because he has now passed the graduation time and when the doors won't open he is now slowly being killed by the very contagion he once carried.
As the Loners begin to search for the escape route David is captured once again by Sam who tortures him before planning to kill him. Sam catches him by putting a reward of food out on the intercom system for anyone who brings David to him, and although the Loners have an alliance with the Sluts, and their leader Violent is girlfriend to the leader of the Nerds, the Nerds sell them out and take David to Varsity for the reward.
Will makes an announcement on the intercom that Sam should meet him on the quad for a fair fight, but when Sam starts the fight Will actually beats him by faking a seizure and then attacking. Will then announces to everyone who came to watch the fight that since all of Varsity showed up on the quad that the food is unattended. All hell breaks loose and Varsity takes off to protect their food while the Loners take David as fast as they can to the tunnel where they believe the outside to be.
The book ends with David getting out of the tunnel but the tunnel collapsing before the rest of the Loners can make it out so David takes off into the outside world to get help, and we see a group of kids bust down the front doors to the school so everyone quarantined can escape, saying the soldiers are "all gone".