The action takes place in Rome, in June 1800
The church of Sant'Andrea della Valle
Angelotti, a political prisoner who has just escaped from the fortress of Castel Sant'Angelo, runs into the church, looks for a key and uses it to open a private chapel, where he hides. The Sacristan bustles about and the painter Mario Cavaradossi continues work on his picture of Mary Magdalene.
He has used as his model a fair-haired woman who has been frequenting the church. While admiring her fair beauty, he prefers the dark loveliness of his mistress, the celebrated singer Floria Tosca. When the Sacristan goes outside, Angelotti emerges from his hiding place and is recognised by Cavaradossi as a fellow revolutionary. Tosca is heard calling to Cavaradossi and he advises Angelotti to hide again, giving him a basket of food he has brought for his own meal. Tosca, having heard his voice, is suspicious that he has been entertaining a woman. He soothes her and they look forward to being together in his villa after her concert that night. She is about to leave when she sees the painting. Her jealousy is aroused again, particularly when she recognises the model as the Marchesa Attavanti. Cavaradossi assures Tosca that he does not know the lady, but has seen her in the church, and she leaves, warning him playfully henceforth to paint only dark-eyed women. Angelotti, emerging from the chapel, reveals that the Marchesa Attavanti is his sister, her presence in the church due to her part in his escape plan, as she has brought women's clothes for him and hidden them in the family chapel. Cavaradossi offers him refuge in his villa outside the city, but before he can leave, a cannon shot signals that the escape has been discovered, and Cavaradossi leaves with him.
The Sacristan, full of the news of the defeat of Napoleon, calls the choirboys to prepare to sing a celebratory Te Deum. Their riotous celebration is interrupted by the arrival of Scarpia, the chief of police, with some of his agents. A search verifies his suspicions that Angelotti had taken refuge in the church, one clue being a fan which Angelotti has dropped. Tosca, returning to tell her lover that she will be late that night because she has to sing in a victory cantata, is disconcerted to find him gone. Scarpia, who has had a lustful eye on her for some time and suspects Cavaradossi's part in the escape, plays on her jealousy in the hope that she will lead him to Angelotti. He shows her the fan, claiming that he found it near the painter's easel - a sign of an interrupted assignation.
Recognising the Attavanti crest, she is only too easily persuaded that Cavaradossi has been unfaithful and sets off for the villa to confront the supposed lovers. Sending his agents after her, Scarpia congratulates himself on the success of his plans, then joins in the Te Deum.
Scarpia's apartment in the Villa Farnese
That night Scarpia eats his supper as he waits for his agents to bring in Angelotti. He sends a note inviting Tosca to visit him after the victory cantata. He is furious when his agent Spoletta confesses that they had found no trace of Angelotti, but mollified when he learns that they have arrested Cavaradossi because of his suspicious behavior. Cavaradossi defies Scarpia and denies knowing anything about Angelotti, so Scarpia orders his interrogation - using any means necessary. He is unsuccessful in his attempt to trick Tosca into revealing Angelotti's whereabouts, but she is unable to resist Cavaradossi's cries of pain as he is tortured, and gives the information.
Cavaradossi reproaches her bitterly. When news is brought that Napoleon had after all been victorious at Marengo, he exultantly taunts Scarpia, who orders his immediate execution. At first Scarpia turns a deaf ear to Tosca's pleas for mercy, but then reveals that the price for Cavaradossi's life is Tosca herself. In despair, she sees no way out, despite her revulsion, which only makes her more desirable in Scarpia's eyes.
In her presence he gives the orders for a fake execution, expressing himself in such a way that it is clear to Spoletta, but not to Tosca, that the execution is in fact to be real. She demands a safe-conduct for herself and Cavaradossi, so that they can leave Rome for ever. As he writes it, she notices a knife on the table, and as Scarpia prepares to embrace her, she stabs him.
Castel Sant'Angelo towards dawn
A shepherd sings in the distance and church bells ring as preparations are made for the execution. Cavaradossi tries to write a last letter to Tosca, but is overcome by memories of their happiness.
Tosca runs in with the safe-conduct and tells him that she has killed Scarpia. Telling him about the mock execution, she instructs him how to fall and wait till the soldiers have gone, but when she calls him, Cavaradossi does not move and she discovers that he is dead. Angry cries indicate that Scarpia's death has been discovered and Spoletta leads the soldiers in pursuit of Tosca, but she leaps from the battlements.