Edinburgh's Ross Ford and Simon Webster combine to stop Leinster's Felipe Contepomi
Edinburgh (16) 29
Tries: Webster, Cairns
Cons: Godman 2
Pens: Godman 4
Leinster (10) 10
Leinster's bid for a Heineken Cup quarter-final spot suffered a major blow after they lost to Edinburgh.
Felipe Contepomi put the visitors ahead early on but the home side hit back with three Phil Godman penalties.
Edinburgh's Simon Webster then touched down in the corner but Leinster were handed a lifeline with a penalty try.
Ben Cairns added an interception try to Mike Blair's drop-goal and although Leinster dominated possession, Edinburgh hung on for a fine victory.
And to complete a disappointing day for Leinster, Ireland skipper Brian O'Driscoll limped off in the closing seconds with an injury while winger Shane Horgan went off with a rib problem.
The defeat leaves Leinster with two losses from their first four games and facing an uphill task to get out of their group.
Leicester and Toulouse are now likely to be the teams battling it out for top spot.
Leinster started the game well and got on the front foot when Malcolm O'Kelly charged down Blair's box kick in the opening exchanges.
Contepomi's penalty on four minutes put Leinster ahead but they could not turn their pressure into points while indiscipline allowed Godman to put Edinburgh 9-3 ahead.
The home side's lead was then extended when Andy Turnbull's outside break had the Leinster defence scrambling and the wing released fit-again Simon Webster who scored in the corner.
As the first half drew to a close, Leinster were camped in the Edinburgh 22 but Godman held up Guy Easterby in the in-goal area while Jamie Heaslip dropped the ball as he dived over the line.
Leinster were given a route back into the game deep into first-half injury time when Nick De Luca blocked O'Driscoll as the Irish province attacked and referee Tim Hayes awarded a penalty try.
Blair made the score 19-10 with a drop goal just after the break and Edinburgh then took advantage as a desperate Leinster attempted to get back into the game.
Rob Kearney tried to offload under pressure and Edinburgh full-back Cairns gratefully accepted the ball and ran in for a simple try.
Leinster threw everything at Edinburgh but the home side's defence held firm and Godman completed the victory with his fourth penalty with two minutes to go.
Edinburgh: Cairns; Turnbull, De Luca, Houston, Webster; Godman, M Blair; Allori, Ford, Smith, Mustchin, Gissing, Cross, Rennie, Callam.
Replacements: Kelly, Jacobsen, Hamilton, Hogg, Meyer, D Blair, MacRae.
Leinster: Dempsey; Horgan, O'Driscoll (capt), D'Arcy, Kearney; Contepomi, Easterby; Le Roux, Jackman, Wright, Cullen, O'Kelly, Keogh, Jennings, Heaslip.
Replacements: Blaney, Healy, Jowitt, Gleeson, Keane, Sexton, Fitzgerald.
Referee: T Hayes (WRU)