Following the conclusion of World War II in Europe, and with Denmark liberated from German occupation in May 1945, the Wehrmacht and SS occupiers found themselves as prisoners of war. A cohort of young German detainees is dispatched to the west coast, where they are trained to clear the landmines that their compatriots had previously buried in the sand using only their hands. Under the stern command of Danish Sergeant Carl Leopold Rasmussen, the boys are held to a grueling standard: if each of them can defuse six mines per hour for a total of 45,000, they may return home in three months.
One of the prisoners, Sebastian Schumann, clings to hope as they share dreams of returning home. The post-war food shortages make their situation dire, leading to severe malnutrition. In attempts to alleviate this, Ernst befriends a local girl to pilfer bread for sustenance. Tragedy strikes when Wilhelm suffers a catastrophic accident while disarming a mine, losing both arms, and eventually succumbs in a field hospital. Most of the boys fall ill after consuming grain tainted with rat feces they found on a nearby farm, prompting a harsh treatment regimen from Rasmussen, who forces them to purge using seawater. Yet, as time progresses, Rasmussen softens somewhat, secretly pilfering provisions from his own supplies to boost the boys’ morale, even allowing them to utilize a device created by Sebastian to enhance their efficiency.
Rumors of Rasmussen’s clandestine generosity reach his superior, Captain Ebbe Jensen, who brings along British troops to intimidate the young Germans. Although Rasmussen intervenes to protect his charges from abuse, he faces scrutiny from Jensen for allegedly exhibiting sympathy toward the boys. Further heartache ensues when Werner encounters a deadly cluster of landmines, resulting in devastation for his twin brother, Ernst.
After an innocuous game of football, Rasmussen's dog tragically dies when it wanders into a supposedly safe area. Devastated, Rasmussen’s anger resurfaces, and his treatment of the boys deteriorates again. He forces them into perilous marches to verify the safety of the beach, disregarding their lives. When a young local girl inadvertently strays into an uncleared section, the mother’s frantic search for Rasmussen yields no fruit as he is absent. Responding with bravery, the boys step forward to rescue her: Ernst ventures into the minefield to calm the girl while Sebastian meticulously clears a path. They succeed in saving the child, but Ernst, unable to bear the thought of life without his brother, tragically chooses to end his own life by stepping into the uncleared area.
Witnessing this act of altruism profoundly impacts Rasmussen, leading him to become more compassionate towards the remaining boys. He comforts a heartbroken Sebastian, assuring him that freedom is near. As four boys continue their arduous task of clearing the beach alongside Rasmussen, others are sent to load unexploded mines onto a truck. In a dreadful moment of carelessness, one boy tosses an improperly defused mine onto the truck, resulting in a catastrophic explosion that claims multiple lives, leaving only Sebastian, Ludwig, Helmut, and Rodolf alive.
Though the boys had been promised liberation upon completing their mission, unbeknownst to Rasmussen, Jensen plans to dispatch the last survivors to another hazardous area. In a desperate bid to save them, Rasmussen pleads for Jensen to reverse his decision but is met with resistance. Ultimately, he decides to act, transporting the boys close to the German border, offering them a desperate chance at freedom.