Through his open office window at the Farnese Palace, Scarpia hears the concert at which Tosca is supposed to be singing the new cantata – but she is late and the cantata is delayed. He sends a note to be delivered the moment she arrives at the palace. Spoletta arrives to tell him they followed Tosca to Cavaradossi’s villa – that they did not find Angelotti but they have brought Cavaradossi in for questioning.
The painter denies he is hiding Angelotti, as the sound of the cantata, now with Tosca singing, is heard through the open window. Following the concert, Tosca enters, responding to Scarpia’s note. Cavaradossi hardly has time to tell her to keep silent before he is led into a secret room to be tortured.
Unable to stand the sound of his screams, Tosca breaks down and reveals Angelotti’s hiding place. Cavaradossi’s outburst of anger at her, and defiance of Scarpia is interrupted by news that the earlier report was wrong and that Napoleon has defeated Melas at Marengo. Cavaradossi’s ensuing hymn of liberty ensures his execution, and he is led away.
Scarpia now tells Tosca there is one way she can save her Mario – and that is to make love to him. Scarpia dangles the image of the gallows before the terrified Tosca. She agrees to his demand – but only if he first releases Cavaradossi. He says he can’t publicly release him, but that he will arrange for a simulated execution. Once accomplished, Tosca and her lover can leave Rome. To prove his (alleged) good will, he signs a passage of safe conduct for them both. As he is writing, Tosca grabs a knife – and at the moment of Scarpia’s embrace – she kills him. She takes the note from the dead man’s fist, places two candles beside him and a crucifix on his chest as she slowly leaves the room.
At the tower of the Castel Sant’Angelo, near dawn, Cavaradossi is brought from his cell. His last thoughts are of Tosca. To his surprise, she is allowed to see him, and she tells him everything has been arranged – all he needs to do is go through the mock execution, and they will be free. Incredulous, Cavaradossi makes her tell him the entire story – and she reveals that she killed Scarpia in desperation. They think of their future happiness, far from Rome, across the sea.
The firing squad arrives and Tosca tells Mario to pretend to fall down at the first shot. The shots are fired and he seems to comply. Once the guards have left, however, Tosca runs to him only to discover that the execution was real. Voices can be heard approaching; the guards have discovered Scarpia’s body. Cornered, Tosca runs to the parapet and jumps from the heights of the castle with the cry, “Scarpia, we will meet before God.”