Agen (13) 19
Pens: Miquel 3, Gelez
Edinburgh (3) 17
Pens: Godman 4
Edinburgh's quest to become Scotland's first team to snatch a Heineken Cup win in France ended in cruel frustration.
A brilliant late try by Canadian winger Mike Pyke appeared to have sealed a famous win after a stirring fightback.
But Agen substitute Francois Jelez thumped over the clinching penalty just two minutes from time.
Edinburgh trailed 13-3 at the interval but dug in and four penalties from stand-off Phil Godman ensured that the visitors were always in the game.
The opening 15 minutes looked ominous for Edinburgh but they managed to survive the early storm with their line still intact.
But Lynn Howells' side were making too many mistakes and, when Agen snubbed the chance of a pot at goal, their penalty gamble paid off as hooker Jalil Narjissi was driven across the line.
Jerome Miquel confidently stroked over the conversion - then stretched the advantage after 24 minutes with a penalty for hands in a ruck.
Edinburgh were more composed in the closing stages of the half, but fell further behind when Miquel slotted his second penalty.
However, there was enough time for Godman to get his side off the mark with an identical score.
Miquel was back on target six minutes after the restart before Edinburgh began to rally.
Godman bagged two more penalties in quick succession as the home team began to show signs of nerves.
And the level-headed stand-off found the target again 10 minutes later to pave the way for a tense finale.
Pyke then silenced the crowd with the score that edged his team in front for the first time.
The forwards did the spadework before Godman's beautifully weighted grubber kick fell perfectly for the Canadian to pounce on.
But Edinburgh could not hold on and fell to defeat after the killer blow from Jelez.
Agen: Lafforgue (capt); Ahotaeiloa, Stoltz, Mignardi, Mirande; Gelez, Morlaes; Van Niekerk, Narjissi, Galasso; Badenhorst, Koulemine; Lievremont, Yukes, Soucaze.
Replacements: Tiatia, Guinazu, Culine, Fonua, Carabignac, Miquel, Vainqueur.
Edinburgh: Southwell; Cairns, Di Rollo, Dewey, Webster; Godman, Blair; Jacobsen, Hall, Smith; Mustchin, Murray (capt); Strokosch, Rennie, Callam.
Replacements: Kelly, Dickinson, Pringle, MacDonald, Laidlaw, Hodge, Pyke.