In a hotel in Bergen, Norway, a British Intelligence agent posing as a member of Mark Mendes's dance band is shot dead while performing on stage. Mendes is thought by British Intelligence to be a Nazi agent, passing on information about merchant shipping to German U-boats, using some kind of code concealed in his hotel band's music, which is broadcast on the radio.
In England, another British agent is selected and sent to replace the murdered man. However, in a mix-up during the blackout at Dover station, George Hepplewhite, ukulele player with the Dinky Doo Concert Party, is mistaken for the agent and sent to Bergen instead.
Arriving at the hotel in Norway, George meets Mary Wilson, an undercover British agent posing as a receptionist. She assumes that George is also a British agent. George, unaware of this, successfully auditions for a position in Mendes's band.
Mendes, preparing to send another coded message, is suspicious of George. He sends an accomplice, Iris, to seduce George and steal his passport for further investigation. Iris is thwarted when Mary interrupts her attempts to frisk the embarrassed George. Meeting with George later on, Mary tells George of Mendes's nefarious activities and George is sent to discover the key to the code. Spotting a code chart in Mendes's room, George photographs the document while Mendes bathes, escaping through a window and falling into a bakery dough-mixing machine.
Examining the chart later, George and Mary work out that Mendes is sending messages through his broadcasts using Morse code in his musical arrangements. They alert British forces to the scheme, so that destroyers can lie in wait for the U-boats after the next broadcast.
Following the broadcast, Mendes discovers that his code has been broken. To find out whether George is a British agent, he gives him a cup of coffee containing a truth serum. George reveals that he and Mary are British spies. George, drugged, is left in his room, where he dreams of flying to Germany and punching Hitler.
When George awakes, he has forgotten his confessions, joining the band for their next performance. Mendes plans to have George shot on stage, but George slips away from his seat, playing a song as he walks around the room, eventually managing to escape.
George flees to join Mary on board a ship, the Macaulay. However, he is too late: the boat has already departed. George boards a motorboat, hiding under a tarpaulin when Mendes suddenly climbs aboard with his henchman, Olaf.
The craft moves off to meet a U-boat. George overhears Mendes's plans to transmit the positions of troop ships and the Macaulay to the Nazis, so that the vessels can be torpedoed. While Mendes boards the waiting U-boat, George overpowers Olaf and takes his place, disguised by a large hat.
On board the U-boat, George sabotages the radio so that the British ships' coordinates cannot be sent. When the radio operator goes to report the problem to his superiors, George contacts the Macaulay and tells Mary of Mendes's plan.
Alerted to the danger, a British warship searches for the U-boat. George disrupts German attempts to launch a torpedo, moving the U-boat's depth controls and plunging it deeper into the sea, with chaotic results. George accidentally launches torpedoes. They miss, but alert the British to the position of the U-boat. They attack with depth charges. George hides in a torpedo launching tube. Finally, the U-boat crew surrenders. Mendes, in a last desperate attempt to sink the Macaulay, launches what he thinks is a torpedo, but is in fact George. George flies through the air and lands on the Macaulay, where he is reunited with Mary.