Scotland ended a 10-year winless streak against France to record back-to-back Six Nations victories for the first time in three years.
The hosts recovered from Guilhem Guirado’s early try to lead 18-5 after Stuart Hogg and Duncan Taylor tries, the latter a superb individual effort.
Gael Fickou’s score reduced France’s half-time deficit, and two Maxime Machenaud penalties made it 21-18.
But Hogg’s brilliant overhead pass saw Tim Visser’s try secure victory.
Greig Laidlaw’s penalty with five minutes left added further gloss to a rapturously received triumph, their first over France since 2006.
It also ended a demoralising sequence of seven straight home Six Nations defeats at Murrayfield over three years since Ireland were beaten in 2013.
Scotland’s victory confirmed England, who beat Wales on Saturday for their fourth straight win, as Six Nations champions, the first time the title has been decided with a round to go.