Time: The close of the 18th century
Place: St. Petersburg, Russia
Act 1
Scene 1
During the reign of Catherine the Great (1762–96), children are at play in St. Petersburg's Summer Garden pretending to be soldiers. Two officers — Tsurin and Chekalinsky — enter, the former complaining about his bad luck at gambling. They remark that another officer, Herman, seems obsessed with the gaming table but never bets, being frugal and methodical. Herman appears with Tomsky, who remarks that his friend hardly seems like his old self: is anything bothering him? Herman admits he is in love with a girl above his station whose name he does not even know. When Prince Yeletsky, an officer, strolls into the park, Chekalinsky congratulates him on his recent engagement. Yeletsky declares his happiness while Herman, aside, curses him enviously. Yeletsky points out his fiancée, Liza, who has just appeared with her grandmother, the old Countess. Catching sight of Herman, the two women note they have seen him before, staring at them with frightening intensity. Herman realizes that Liza is his unknown beloved. When Yeletsky and the women leave, Herman is lost in thought as the other officers discuss the Countess: known as the Queen of Spades and formerly as the Muscovite Venus, due to her beauty, she succeeded at gambling in her youth by trading amorous favors for the winning formula of Count St. Germain in Paris. Tomsky says only two men, her husband and, later on, her young lover, ever learned the secret of playing three special cards, because she was warned by an apparition to beware a "third suitor" who would kill her trying to force it from her. Musing on the winning sequence of three cards, the others lightly suggest that this might be the way for Herman to win without risking any money. Threatened by approaching thunder, all leave except Herman, who vows to learn the Countess's secret.
Scene 2
At home, Liza plays the spinet as she and her friend Pauline sing a duet about evening in the countryside. Their girlfriends ask to hear more, so Pauline launches into a sad ballad, followed by a dancelike song. As the merriment increases, Liza remains pensively apart. A Governess chides the girls for indulging in unbecoming folk dancing and asks the visitors to leave. Pauline, the last to go, urges Liza to cheer up; Liza replies that after a storm there is a beautiful night and asks the maid, Masha, not to close the French windows to the balcony. Alone, Liza voices her unhappiness with her engagement; she has been stirred by the romantic look of the young man in the park. To her shock, Herman appears on the balcony. Claiming he is about to shoot himself over her betrothal to another, he begs her to take pity on him. When the Countess is heard knocking, Liza hides Herman and opens the door to the old woman, who tells her to shut the windows and go to bed. After the Countess retires, Liza asks Herman to leave but is betrayed by her feelings and falls into his embrace.
Act 2
Scene 1
Not long afterward, at a masked ball, Herman's comrades comment on his obsession with the secret of the winning cards. Yeletsky passes with Liza, noting her sadness and reassuring her of his love ("Ya vas lyublyu" "I love you"). Herman receives a note from Liza, asking him to meet her later. Tsurin and Chekalinsky sneak up behind him with the intent of playing a joke on him, muttering he is the "third suitor" who will learn the Countess's secret, then melt into the crowd as Herman wonders whether he is hearing things. The master of ceremonies announces a tableau of shepherdesses. Liza slips Herman the key to her grandmother's room, saying the old woman will not be there the next day, but Herman insists on coming that very night. Thinking fate is handing him the Countess's secret, he leaves. The guests' attention turns to the imminent arrival of Catherine the Great, for which a polonaise by Osip Kozlovsky is played and sung in greeting.
Scene 2
Herman slips into the Countess's room and looks in fascination at her portrait as the "Muscovite Venus"; musing how their fates, he feels, are linked: one of them will die because of the other. He lingers too long before he can go to Liza's room and hears the Countess's retinue coming, so he conceals himself as the old lady approaches. The Countess deplores the manners of the day and reminisces about the better times of her youth, when she sang in Versailles "Je crains de lui parler la nuit" (Laurette's Aria) from André Grétry's opera Richard Cœur-de-Lion before the Pompadour herself. As she dozes off, Herman stands before her. She awakens in horror as he pleads with her to tell him her secret. When she remains speechless, he grows desperate and threatens her with a pistol — at which she dies of fright. Liza rushes in, only to learn that the lover to whom she gave her heart was more interested in the Countess's secret. She orders him out and falls sobbing.
Act 3
Scene 1
In his room at the barracks, as the winter wind howls, Herman reads a letter from Liza, who wants him to meet her at midnight by the river bank. He imagines he hears the chorus chanting at the old Countess's funeral, then is startled by a knock at the window. The old woman's ghost appears, announcing that against her will she must tell him the secret so that he can marry and save Liza. Dazed, Herman repeats the three cards she tells him — three, seven, ace.
Scene 2
By the Winter Canal, Liza waits for Herman: it is already near midnight, and though she clings to a forlorn hope that he still loves her, she sees her youth and happiness swallowed in darkness. At last he appears, but after uttering words of reassurance, he starts to babble wildly about the Countess and her secret. No longer even recognizing Liza, he rushes away. Realizing that all is lost, she commits suicide.
Scene 3
At a gambling house, Herman's fellow officers are finishing supper and getting ready to play faro. Yeletsky, who has not gambled before, joins the group because his engagement has been broken: "unlucky in love, lucky at cards". Tomsky entertains the others with a song. Then Chekalinsky leads a traditional gamblers' song. Settling down to play, they are surprised when Herman arrives, wild and distracted. Yeletsky senses a confrontation and asks Tomsky to be his second if a duel should result. Herman, intent only on betting, starts with a huge bet of 40,000 rubles. He bets the three and wins, upsetting the others with his maniacal expression. Next he bets the seven and wins again. At this he takes a wine glass and declares that life is but a game. Yeletsky accepts his challenge to bet on the next round. Herman bets everything he has on the ace but when he shows his card he is told he is holding the queen of spades. Seeing the Countess's ghost laughing at her vengeance, Herman takes his own life and asks Yeletsky's and Liza's forgiveness. The others pray for his tormented soul.