The play takes place during the 1885 Serbo-Bulgarian War. Its heroine, Raina (rah-EE-na) Petkoff, is a young Bulgarian woman engaged to Sergius Saranoff, one of the heroes of that war, whom she idolizes. One night, a Swiss mercenary soldier in the Serbian army, Captain Bluntschli, climbs in through her bedroom window and threatens to shoot Raina if she gives the alarm. When Russian/Bulgarian troops burst in to search the house for him, Raina hides him so that he won't be killed. In a conversation after the soldiers have left, Bluntschli's attitude towards war and soldiering (pragmatic and practical as opposed to Raina's idealistic views) shock her, especially after he admits that he uses his ammunition pouches to carry chocolates rather than cartridges for his pistol. When the search dies down, Raina and her mother Catherine sneak Bluntschli out of the house, disguised in an old housecoat.
The war ends with the Bulgarians and Serbians signing a peace treaty and Sergius returns to Raina, but also flirts with her insolent servant girl Louka (a soubrette role), who is engaged to Nicola, the Petkoffs' manservant. Raina begins to find Sergius both foolhardy and tiresome, but she hides it. Bluntschli unexpectedly returns so that he can give back the old housecoat, but also so that he can see her. Raina and her mother are shocked, especially when her father and Sergius reveal that they have met Bluntschli before and invite him to stay for lunch (and to help them with troop movements).
Afterwards, left alone with Bluntschli, Raina realizes that he sees through her romantic posturing, but that he respects her as a woman, as Sergius does not. She tells him that she had left a photograph of herself in the pocket of the coat, inscribed "To my chocolate-cream soldier", but Bluntschli says that he didn't find it and that it must still be in the coat pocket. Bluntschli gets a telegram informing him of his father's death and revealing to him his now-enormous inheritance. Louka then tells Sergius that Bluntschli is the man whom Raina protected and that Raina is really in love with him. Sergius challenges Bluntschli to a duel, but Bluntschli avoids fighting and Sergius and Raina break off their engagement (with some relief on both sides). Raina's father, Major Paul Petkoff, discovers the portrait in the pocket of his housecoat, but Raina and Bluntschli trick him by removing the photograph before he finds it again in an attempt to convince him that his mind is playing tricks on him, but Petkoff is determined to learn the truth and claims that the "chocolate-cream soldier" is Sergius. After Bluntschli reveals the whole story to Major Petkoff, Sergius proposes marriage to Louka (to Mrs. Petkoff's horror); Nicola quietly and gallantly lets Sergius have her, and Bluntschli, recognising Nicola's dedication and ability, determines to offer him a job as a hotel manager.
While Raina is now unattached, Bluntschli protests that—being 34 and believing she is 17—he is too old for her. On learning that she is actually 23, he immediately proposes marriage and proves his wealth and position by listing his inheritance from the telegram. Raina, realizing the hollowness of her romantic ideals, protests that she would prefer her poor "chocolate-cream soldier" to this wealthy businessman. Bluntschli says that he is still the same person, and the play ends with Raina proclaiming her love for him and Bluntschli, with Swiss precision, both clearing up the major's troop movement problems and informing everyone that he will return to be married to Raina exactly two weeks from Tuesday.