Both Scottish clubs guaranteed places in the Champions Cup quarter-final after Edinburgh's victory over Montpellier
Edinburgh sealed Heineken Champions Cup quarter-final places for themselves and Glasgow with a 19-10 victory over Montpellier.
The win secured top spot in Pool 5 and a home contest for Richard Cockerill's side in the last eight, and ensured Glasgow will finish as one of the three best runners-up if they lose their group decider against Saracens in London on Saturday.
Should Leinster, Racing 92 and Saracens win, as expected, over the weekend, Munster will travel to Edinburgh in the last eight if they top Pool 2.
Darcy Graham's try just after the hour mark was just reward for a spell of intense pressure that proved the key passage of play in front of 11,802 fans at BT Murrayfield - a Scottish record for a European pool match.
Montpellier - coached by former Scotland boss Vern Cotter - had got themselves back in the contest following three penalties from Jaco Van Der Walt, with a try from Jacques Du Plessis on the stroke of half-time.
But the penalty that put them ahead seven minutes into the second half jolted the hosts back into the ascendancy and they went on to seal an historic achievement for Scottish rugby as both clubs reached the knockout stages of Europe's premier competition for the first time together.
Edinburgh made the better start and Van Der Walt kicked two penalties as the pressure forced the visitors into infringements.
Montpellier began to settle but their only flash of creativity, when Johan Goosen kicked the ball into the path of winger Henry Immelman, was met by excellent tackles from both Blair Kinghorn and Graham.
Edinburgh lost Scotland flanker Hamish Watson to injury but they went further ahead when Van Der Walt dispatched the second of two penalties near the 40-metre line, after Jacques Du Plessis had swung an arm at WP Nel without further punishment.
Bismarck Du Plessis also evaded action after pushing an Edinburgh physio as he tried to retrieve the ball in touch, and the visitors made the most of their first penalty of the game in the final seconds of the half.
Ruan Pienaar took it quickly inside the 22 and Jacques Du Plessis was adjudged by the TMO to have touched down inches over the line.
The French side maintained the momentum and Pienaar kicked them ahead seven minutes after the restart.
But Edinburgh soon turned things round as they stepped up the tempo. Van Der Walt's kick beyond the try-line was snuffed out by Pienaar, Duhan Van Der Merwe burst past three players before being stopped and the pressure eventually told when Montpellier conceded a penalty at a driving maul five metres out. Van Der Walt restored the hosts' lead.
The hosts continued to stretch Montpellier and, after several near misses from a series of rucks near the line, Henry Pyrgos fed Graham to cross on the right flank. Van Der Walt added two points.
The visitors desperately attempted to fight back but Edinburgh stood firm to seal a memorable triumph.