Cesare Angelotti, an escaped political prisoner, rushes into the church of Sant' Andrea della Valle to hide in the Attavanti chapel. As he vanishes, an old Sacristan shuffles in, praying at the sound of the Angelus. Mario Cavaradossi enters to work on his portrait of Mary Magdalene - inspired by the Marchesa Attavanti (Angelotti's sister), whom he has seen but does not know. Taking out a miniature of the singer Floria Tosca, he compares her raven beauty with that of the blonde Magdalene. The Sacristan grumbles disapproval and leaves.
Angelotti ventures out and is recognized by his friend and fellow liberal Mario, who gives him food and hurries him back into the chapel as Tosca is heard calling outside. Forever suspicious, she jealously questions him, then prays, and reminds him of their rendezvous that evening at his villa. Suddenly recognizing the Marchesa Attavanti in the painting, she explodes with renewed suspicions, but he reassures her.
When she has gone, Mario summons Angelotti from the chapel; a cannon signals that the police have discovered the escape, so the two flee to Mario's villa. Meanwhile, the Sacristan returns with choirboys who are to sing in a Te Deum that day. Their excitement is silenced by the entrance of Baron Scarpia, chief of the secret police, in search of Angelotti. When Tosca comes back to her lover, Scarpia shows her a fan with the Attavanti crest, which he has just found. Thinking Mario faithless, Tosca tearfully vows vengeance and leaves as the church fills with worshipers. Scarpia, sending his men to follow her to Angelotti, schemes to get the diva in his power ("Va, Tosca!").
In the Farnese Palace, Scarpia anticipates the sadistic pleasure of bending Tosca
to his will. The spy Spoletta arrives, not having found Angelotti; to placate the baron he brings in Mario, who is interrogated while Tosca is heard singing a cantata at a royal gala downstairs. She enters just as her lover is being taken to an adjoining room: his arrogant silence is to be broken under torture. Unnerved by Scarpia's questioning and the sound of Mario's screams, she reveals Angelotti's hiding place. Mario is carried in; realizing what has happened, he turns on Tosca, but the officer Sciarrone rushes in to announce that Napoleon has won the Battle of Marengo, a defeat for Scarpia's side.
Mario shouts his defiance of tyranny and is dragged to prison. Scarpia, resuming his supper, suggests that Tosca yield herself to him in exchange for her lover's life. Fighting off his embraces, she protests her fate to God, having dedicated her life to art and love. Scarpia again insists, but Spoletta interrupts: faced with capture, Angelotti has killed himself. Tosca, forced to give in or lose her lover, agrees to Scarpia's proposition. The baron pretends to order a mock execution for the prisoner, after which he is to be freed; Spoletta leaves. No sooner has Scarpia written a safe-conduct for the lovers than Tosca snatches a knife from the table and kills him. Wrenching the document from his stiffening fingers and placing candles at his head and a crucifix on his chest, she slips from the room.
The voice of a shepherd boy is heard as church bells toll the dawn. Mario awaits execution at the Castel Sant'Angelo; he bribes the jailer to convey a farewell note to Tosca. Writing it, overcome with memories of love, he gives way to despair.
Suddenly Tosca runs in, filled with the story of her recent adventures. Mario caresses the hands that committed murder for his sake, and the two hail their future. As the firing squad appears, the diva coaches Mario on how to fake his death convincingly; the soldiers fire and depart. Tosca urges Mario to hurry, but when he fails to move, she discovers that Scarpia's treachery has transcended the grave: the bullets were real. When Spoletta rushes in to arrest Tosca for Scarpia's murder, she cries to Scarpia to meet her before God, then leaps to her death.