Angelotti, the former Consul of the Republic of Rome, has escaped from the state prison at the Castle St. Angelo and sought refuge in the church of St. Andrea della Valle, where his sister, the Countess Attavanti, has deposited the key to a hidingplace. Angelotti conceals himself when the Sacristan arrives. The latter, outraged, finds that the painter Cavaradossi has given the altar painting on which he is working - a figure of Mary Magdalena - the features of a beautiful unknown woman who has often been observed at prayer in the church recently. While Cavaradossi admits that the stranger has, unknowingly, served as a model for him, his heart belongs only to bis beloved, the singer Floria Tosca, who closely resembles her. When the verger leaves, Angelotti comes out from his hidingplace, believing that he is now alone. He recognizes his friend Cavaradossi, who is prepared to assist him. So that no one shall find him with the fugitive, the painter locks the chapel door.
Then Tosca appears and the locked door arouses her jealousy but Cavaradossi pacifies her and they arrange to meet that evening. However, Tosca's jealousy is reawakened when she recognizes in Cavaradossi's picture the Countess Attavanti. Once more the painter succeeds in convincing her of his faithfulness. She has hardly left the church when a cannon is fired, showing that Angelotti's escape has been discovered. Speed is now essential and Cavaradossi decides to hide the fugitive in a well in the garden of his house. When the Sacristan enters the church with the news that the Italian and Austrian forces have defeated Napoleon, Cavaradossi has disappeared. Exulting over the victory, the Sacristan prepares the choirboys for the Te Deum.
The joyous confusion is brought to a sudden halt by the arrival of Scarpia, the much-feared Chief of police, who, with his benchmen, is in pursuit of Angelotti. A fan of countess Attavanti found in the chapel, shows him that he is on the right track. Scarpia also discovers Attavantis features in Cavaradossi's painting and when Tosca now returns to tell the painter that she has to sing at the victory celebration being staged by the Queen, Scarpia inflames her jealousy in order to discover what she knows and urges Spoletta and his men to follow her.
It is evening and Scarpia is awaiting the arrival of Tosca, while on the floor below the Queen's celebrations are beginning. Spoletta appears, but without the fugitive Angelotti. Instead he has arrested Cavaradossi, but Scarpia is unable to wring a confession from him. When Tosca enters the room the painter warns her not to betray anything. Scarpia orders that the painter be tortured in an adjoining room. Anguished by the cries of her lover, Tosca betrays Angelotti's hidingplace. The torture ceases. But when Cavaradossi hears that Napoleon, and not the Italian and Austrian forces, has won the day he passionately avows bis political ideals. Scarpia has him taken away and explains to Tosca, whom he holds back, that this confession has finally sealed Cavaradossi's fate. Tosca begs for her lover's life and, in the end, Scarpia promises that he will only pretend to have Cavaradossi shot if she gives herself to him. In utter despair, Tosca agrees. But as Scarpia writes out the pass that will give her and Cavaradossi their freedom she takes a knife from the table and kills him.
At dawn preparations are being made at the Castle St. Angelo for Cavaradossi's execution. The painter succeeds in obtaining pencil and paper from a guard in order to write Tosca a farewell note. Memories overwhelm him. Then Tosca herself appears before him and relates what has happened. She tells him that the execution will be a pretence. The execution squad appears. They fire and Cavaradossi falls dead. Tosca, in hopeless despair, realizes that Scarpia has tricked her and hurls herself from the battlements.