In Warsaw, Poland, during August, 1939, actors at the Theatre Polsky rehearse their new play Gestapo , about the Nazi regime in Germany. When a question arises over the authenticity of actor Bronski's portrayal of Adolph Hitler, Germany's führer, Bronski goes into the public square to gauge public reaction. Hitler's apparent arrival in town causes a commotion until a child asks for the actor's autograph. Later, the actors perform in their production of William Shakespeare's Hamlet and the performance of the featured player, Joseph Tura, is marred when military aviator Lieutenant Stanislav Sobinski, sitting in the second row, gets up at the beginning of Hamlet's soliloquy and walks out. Unknown to Joseph, Stanislav has arranged to meet Joseph's beautiful wife, Maria, a popular actress, in her dressing room. Stanislav is an ardent fan of Maria and has fallen in love with her by reading every article and interview about her. Maria is flattered by Stanislav's attention and agrees to a flight in his bomber. When the Polish government prevents producer Dobosh from putting on Gestapo because the content might offend Hitler, the theater troupe reluctantly complies and continues with Hamlet . Maria also continues her clandestine meetings with Stanislav, and Joseph's overblown ego becomes bruised by the aviator's repeated departure from the second row during his soliloquy. Life has changed completely by the Spring of 1940, after Germany invades Poland without warning and the country is plunged into war. Stanislav is now a member of the Polish bomber pilot squadron for the Royal Air Force in England. As German troops overtake a devastated Warsaw, Nazi Colonel Ehrhardt places severe restrictions on the local citizens. Meanwhile, in England, Polish bomber pilots become excited when they learn that fellow countryman, Professor Siletsky, is returning to Warsaw on a secret mission. They give him the addresses of their families after he offers to communicate with them, and Stanislav gives him a secret code to give to Maria, which reads: "To be or not to be." Stanislav becomes suspicious of Siletsky because he is ignorant of the nationally known actress, and reports him to Military Intelligence. Further suspicions that Siletsky is a Nazi spy prompt British Military Intelligence to send Stanislav to Warsaw, so that he can preempt Siletsky's report to the Nazis on the Polish underground. Despite enemy fire, Stanislav parachutes safely into Poland, but is unable to reach the pre-arranged communication point at a bookstore, so he sends Maria, whom he has located once again, in his place. Siletsky has arrived early, however, and sends for Maria himself, ostensibly to give her Stanislav's message. Instead, Siletsky tries to seduce Maria into becoming a Nazi spy, and she puts him off temporarily by returning to her apartment for a change of clothes that are more suitable for a seduction. Joseph, in the meantime, has discovered his second row walk-out in his bedroom slippers, and demands an explanation, but Maria brushes Stanislav's presence aside to discuss the more important issue: making sure that Siletsky does not give his report to his superior officers. The actors formulate a plan in which Joseph impersonates Colonel Ehrhardt in order to obtain Siletsky's report. When Siletsky becomes suspicious because of Joseph's bad acting, however, he tries to escape. After a chase through the theatre, Stanislav shoots the traitor. Concerned about an additional copy of the report that Siletsky had in his trunk, Joseph goes to Siletsky's room at Gestapo headquarters and impersonates Siletsky. He is immediately taken away for a meeting with Colonel Ehrhardt by Ehrhardt's second-in-command, Captain Schultz, and continues to impersonate Siletsky by giving Ehrhardt a vague report on the Polish underground. The slow-witted Ehrhardt is satisfied with Joseph's report and arranges for him to leave the country, but when Joseph asks to take Maria along, as a novice Nazi spy, Ehrhardt insists on interviewing her. The Nazis find the real Siletsky dead at the theater, and when Joseph returns to Ehrhardt following Maria's visit, he is left alone in a room with Siletsky's body. Joseph cleverly shaves the real Siletsky's beard and attaches a false beard, thereby outwitting Ehrhardt, who tries to force Joseph into admitting he is an impostor. The ruse works until ham actor Rawitch and the rest of the acting troupe arrive impersonating Gestapo officials and "arrest" Joseph after declaring that he is an impostor. Although his friends were only hoping to save his life, Joseph is outraged that they foiled his plans to leave the country, and they all fear they will be killed when the Nazis discover their treachery. With little remaining hope, the actors again don Nazi uniforms and that evening infiltrate the opera house, which is packed with Nazi officials. After Hitler arrives for the evening's performance, his special security force lines the hall. According to plan, Jewish actor Greenberg bursts from the bathroom, and is captured by the Nazis. This provides Greenberg with his long-awaited opportunity to perform a portion of "Shylock's" speech from Shakespeare's The Merchant of Venice . The rest of the performers then emerge from the bathroom and command the situation. Joseph, posing as Hitler's own security chief, arrests Greenberg and demands that the "führer," really Bronski in disguise, leave the theatre immediately for his own safety. The real Gestapo officers then blindly follow Bronski out of the theatre into official cars. As the cars pull away, the railroad station explodes, and the actors realize that the Polish Underground is alive and well, and has struck a major blow against the Nazi regime. Ehrhardt, meanwhile, has trapped Maria in her apartment with hopes of seducing her, until Bronski arrives to pick her up. Ehrhardt is shocked when Maria leaves with his führer, and tries to shoot himself. The actors fly out of Poland in Hitler's own plane, and the German pilots willingly execute their führer's command by jumping out of the plane without parachutes. The acting troupe then lands safely in Great Britain, and Joseph, declared a hero, satisfies a dream by playing "Hamlet" in Shakespeare's homeland. His performance is disrupted, however, when a handsome young officer walks out from the second row during his soliloquy.