Media playback is not supported on this device
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.
The Scots may have started brightly, confidence buoyed by their 36-20 win in Rome a fortnight ago, but their momentum was checked inside five minutes.
France set Murrayfield alight with some of the flair which appeared to have disappeared from their game, resulting in a try for their admirable captain Guirado.
The hooker set Virimi Vakatawa away down the right, and after the wing slipped the ball inside to Wesley Fofana, Guirado was there to collect the scoring pass and plunge over.
Fly-half Francois Trinh-Duc, on his return to the side, missed the conversion from a wide angle, and then what should have been a straightforward penalty attempt.
So instead of a 10-0 deficit, within five minutes Scotland had turned the game on its head with two Laidlaw penalties, the second earned by a scrummage which continued to provide sustenance.
It was an admirable response having lost Finn Russell to a head knock - the fly-half collided with flanker John Barclay's outstretched leg - in the build-up to France's try.
But Russell's replacement Peter Horne stepped into the breach superbly, and his half-break and offload to Richie Gray after a dozen phases allowed Hogg to dart over in the 33rd minute.
Within four minutes. Murrayfield was on its feet again after a stunning solo score from Taylor.
Taking a quick tap penalty 10 metres inside his own half, the Saracens centre sped up the right touchline, bulldozing through the attempted tackle of Vakatawa.
As space opened up in front of him, the 26-year-old motored on, eluding Wenceslas Lauret before touching down for a thunderous try.
Referee Glen Jackson did consult a television replay after a suspicion Laidlaw had impeded Lauret with a tug of his shirt, but was satisfied the Frenchman's momentum had not been checked.
Laidlaw added the conversion for an 18-5 lead, but a penalty conceded by Barclay with two minutes of the half left allowed France to strike back.
The visitors kicked the penalty to touch on the right flank, launched a line-out drive and several phases later, Fickou sliced his way through in the left corner.
Machenaud, taking over the kicking duties from Trinh-Duc, made it a six-point game at the interval.
Hogg's monster 54-metre penalty early in the second half made it 21-12, but two Machenaud penalties reduced the gap to three points heading into the final quarter.
The tension was lifted though in the 66th minute after bullocking charges from Alex Dunbar, Richie Gray and Willem Nel took Scotland to within inches of the French line.
Laidlaw's long pass looked on the speculative side, but Hogg flicked the ball over his head as he rose to meet it, giving Visser the simple task of diving over for his 11th Test try.
Laidlaw was unable to land the conversion from wide out on the touchline, but made no mistake with a penalty five minutes from time to kick-start the Murrayfield celebrations.
Stuart Hogg was a constant danger with ball in hand, scored Scotland's first try, banged over a penalty from 54 metres and his magical overhead pass for Visser's try provided the game's stand-out moment.
Scotland: Hogg, Seymour, Taylor, Dunbar, Visser, Russell, Laidlaw; Dickinson, Ford, Nel, R. Gray, J. Gray, Barclay, Hardie, Strauss.
Replacements: Horne (for Russell, 5), Wilson (for Strauss, 62), McInally (for Ford, 67), Low (for Nel, 73), Swinson (for R Gray, 77).
Not used: Sutherland, Hidalgo-Clyne, Lamont.
France: Spedding, Fofana, Fickou, Mermoz, Vakatawa, Trinh-Duc, Machenaud; Poirot, Guirado, Slimani, Flanquart, Maestri, Camara, Lauret, Chouly.
Replacements: Chat (for Guirado, 70), Pelo (for Poirot, 62), Atonio (for Slimani, 62), Vahaamahina (for Flanquart, 51), Goujon (for Camara, 64), Bezy (for Machenaud, 74), Plisson (for Trinh-Duc, 68), Medard (for Mermoz, 68).
Referee: Glen Jackson (New Zealand)
Scotland ended a 10-year winless streak against France to record back-to-back Six Nations victories for the first time in three years.