Holland under German occupation. Shipyard owner and chief engineer Jaap van Leyden is summoned to the German headquarters. Von Schiller, the German commander, asks him to build ships for the German war effort. The commission would allow Leyden to build the most sophisticated submarines and also safeguard the jobs of the local workforce. Leyden accepts the offer, to the disgust of the townsfolk, and is branded a 'Quisling', or collaborator. However, harsh realities of life under the Germans compel the men to set aside principle and apply for work at Leyden's shipyard.
As work gets underway on the first submarine, U107, it appears that a gang of conspirators is determined to sabotage the construction. The ringleader signs himself 'Piet Hein', after a legendary Dutch hero. A local man leaks the plan to Leyden, expecting to be rewarded and the conspirators to be arrested. However Leyden - who is, in fact, the mysterious 'Piet Hein' - manages, without revealing his identity, to turn the tables on the would-be whistleblower, who is then killed by the conspirators.
When the U107 goes out on her first sea trials, the conspirators overpower the German guard and re-route the vessel for England. The English navy is delighted and sends thanks and congratulations to the Dutch workers in a radio address. Explosions and other acts of sabotage continue at the yard.
Von Schiffer is determined to uncover the identity of 'Piet Hein' and the men responsible for the theft of the submarine. He bullies the townsfolk and rounds up 30 hostages. Leyden intervenes to get the men released.
Sea trials for the second submarine approach. Leyden, who has been keeping notes of his activities in a diary, plans to dynamite the ship by remote control, but it is a risky plan, and security at the shipyard is extremely tight. Leyden, however, still has the trust of Von Schiffer, and is asked to supervise the sea trials.
Leyden invites the German top brass to a dinner party at his home. He persuades each of them to accompany him on the U108 trials scheduled for the following morning. That night and into the small hours, Leyden writes a farewell letter to his beloved wife, explaining everything. He leaves for the shipyard and boards the submarine with the German leaders. The submarine submerges. Leyden sets off an explosion, destroying the submarine and killing himself and all of the Germans on board.