St. Petersburg, late 18th century. In a park, Sourin and Tchekalinsky discuss the strange behavior of their fellow officer Hermann. He seems obsessed with gambling, watching his friends play all night, though he never plays himself. Hermann appears with Count Tomsky and admits to him that he is in love with a girl whose name he doesn’t know. When Prince Yeletsky enters, followed by his fiancée, Lisa, and her grandmother, the old countess, Hermann is shocked to realize that Lisa is his unknown girl. After Yeletsky and the women have left, Tomsky tells the others the story of the countess. Decades ago in Paris, she won a fortune at the gambling table with the help of “the three cards,” a mysterious winning combination. She only ever shared this secret with two other people, and there is a prophecy that she will die at the hands of a third person who will force the secret from her. The men laugh at the story except for Hermann, who is deeply affected by it and decides to learn the countess’s secret.
Lisa thinks about her ambivalent feelings for her fiancé and the impression Hermann has made on her. To her shock, he suddenly appears on the balcony. He declares his love and begs her to have pity on him. Lisa gives in to her feelings and confesses that she loves him too.
Yeletsky has noticed a change in Lisa’s behavior. During a ball, he assures her of his love. Hermann, who is also among the guests, has received a note from Lisa, asking him to meet her. Sourin and Tchekalinsky tease him with remarks about the three cards. A pastoral is performed to entertain the guests. Lisa slips Hermann the key to a garden door that will lead him to her room and through the countess’s bedroom. She says the old lady will not be there the next day, but Hermann insists on coming that very night, thinking that fate is handing him the chance to learn the countess’s secret.
In the countess’s bedroom, Hermann looks fascinated at a portrait of her as a young woman. He hides as the old lady returns from the ball and, reminiscing about her youth, falls asleep in an armchair. She awakens when Hermann suddenly steps before her and demands to know the secret of the cards. The countess refuses to talk to him, and when Hermann, growing desperate, threatens her with a pistol, she dies of fright. Lisa rushes in. Horrified at the sight of her dead grandmother, she realizes that all Hermann was interested in was the countess’s secret
Hermann is descending into obsession. In his quarters, he reads a letter from Lisa asking him to meet her at midnight. He recalls the countess’s funeral and suddenly her ghost appears, telling him that he must save Lisa and marry her. The ghost says that his lucky cards will be three, seven, and the ace.
Lisa waits for Hermann by a canal, wondering if he still loves her. When he at last appears, she says they should leave the city together. Hermann refuses, replying that he has learned the secret of the cards and is on his way to the gambling house. Lisa realizes that she has lost him and drowns herself in the canal.
The officers are playing cards, joined by Yeletsky, who has broken off his engagement to Lisa. Hermann enters, distracted, and immediately bets 40,000 rubles. He wins on his first two cards, a three and a seven. Upsetting the others with his maniacal expression, he declares that life is a game. For the final round, he bets on the ace but loses when his card is revealed as the queen of spades. Horrified and imagining the countess’s face staring at him from the card, Hermann stabs himself, asking for Yeletsky and Lisa’s forgiveness.