ACT I: Angelotti, an escaped political prisoner, takes refuge in a side chapel of the Sant'Andrea della Valle church. A sacristan enters, followed shortly by Cavaradossi, an artist working on a painting of the Madonna. Angelotti ventures out and is recognized by Cavaradossi, who promises to help him escape from Rome. Cavaradossi's lover, Tosca is heard outside; Angelotti hides again before she enters. The sound of conversation has aroused Tosca's jealousy, but Cavaradossi's assurances calm her. When she has left, Cavaradossi and Angelotti plan his flight as a cannon signals that the police have discovered the prison escape; the two flee. The sacristan returns with choirboys who are silenced by the entrance of Baron Scarpia, chief of the secret police, in search of Angelotti. Tosca returns, and Scarpia, suspicious of Cavaradossi and enamored of Tosca, tries to trick her into revealing information by inciting her jealousy. When she leaves to seek out her lover, Scarpia has her followed, and , as the crowd intones the Te Deum, Scarpia vows to bring Cavaradossi to the gallows and Tosca into his arms.
ACT II: In the Farnese Palace, Scarpia anticipates the pleasure of bending Tosca to his will. The spy, Spoletta, enters and reports that Angelotti has not been found, but that he has arrested Cavaradossi for suspicious behavior. Scarpia sends for Tosca, and she enters as Cavaradossi, is led to the next room to be tortured. Tosca is left alone with Scarpia, and Cavaradossi's cries of pain eventually persuade Tosca to reveal Angelotti's hiding-place. Cavaradossi is dragged back onstage just as Napoleon's victory at Marengo is announced, a defeat for Scarpia's side. Cavaradossi shouts his defiance and his dragged to prison. Scarpia offers Tosca a hideous choice: either she must submit to his advances or Cavaradossi dies. She finally agrees to submit. Scarpia pretends to order a mock execution. As Scarpia writes a safe-conduct from Rome for her and her lover, Tosca surreptitiously takes a knife from the dinner table and, when Scarpia comes forward to claim his prize, plunges it into his chest. She taunts him in his death throes and, when he expires, takes the safe-conduct from his clenched hand and starts to leave. At the last moment she returns to place candles around Scarpia's body and a crucifix on his chest.
ACT III: Church bells ring and a shepherd boy sings in the distance. Cavaradossi awaits his final hour. Tosca appears and triumphantly displays their safe-conduct. She instructs him on his role in the mock execution, and they sing their love and hopes for the future. The firing squad arrives and Cavaradossi is prepared for the execution. Tosca watches as Cavaradossi falls. In agony of suspense, she waits for the soldiers to depart. At last she tells Cavaradossi to rise, but he does not respond: Scarpia has betrayed her even in death, and her lover lies dead before her. Soldiers rush on to arrest Tosca for Scarpia's murder, but, with a final defiant gesture, she flings herself over the parapet.