Greig Laidlaw ruined Cardiff Blues' return to the Arms Park when he clinched victory for an impressive Edinburgh side.
The Scotland fly-half landed a 78th-minute drop-goal to snatch victory.
The Edinburgh captain, who had a mixed night with the boot, stepped up to record their first win in Wales since 2009.
The Blues' points came from the boot of Leigh Halfpenny and a try by Alex Cuthbert.
The Blues were ahead for most of this contest, with Cuthbert's try and 14 points kicked by Halfpenny, but they were never truly comfortable against an Edinburgh side which dominated proceedings for long periods in the Welsh capital.
The Scottish side, who reached last season's Heineken Cup semi-finals, recorded their fifth win out of their last six visits to the Arms Park but this was their first win in Wales since they beat the Scarlets in December 2009.
They had won only once on their last 19 trips away in the Pro 12 but were always in control and were well worth this victory against a subdued and inexperienced Blues side on their return to the Arms Park after three years away at the Cardiff City Stadium.
For scrum-half Richie Rees and prop John Yapp, who both left the Blues in the summer for Edinburgh, and featured in this game, the victory would have completed a sweet return home.
Phil Davies, the new Blues director of rugby, will be satisfied with his side's defensive effort but their inability to win or keep possession will be a major concern for him, but his side's creaking scrum which Edinburgh demolished for a penalty try midway through the second half will be at the forefront of his mind.
Laidlaw opened the scoring with the first of his two penalties, before Visser barged his way over after a superb dummy by Edinburgh lock Sean Cox stunned the Blues defence, enabling the flying Dutchman to cross in the left-hand corner to make it 8-3 midway through the first half.
Halfpenny's ever reliable boot clawed the home side back to 9-8 at half-time but the Scottish side's enterprise and desire to play and attack from anywhere had proved to be a problem for a new-look Cardiff Blues line-up back at their spiritual home.
After the break, Visser, who enjoyed a rare old battle with Cuthbert on the wing, nearly created something out of nothing when he left the Blues defence flat-footed with a delightful chip and chase effort only to see the ball run out of play.
The Scots were then down to 14 men when full back Greig Tonk was sin-binned for a professional foul at the tackle area before wing Cuthbert crossed for the Blues' only try midway through the second half, which Halfpenny converted to make it 16-11 to the home side.
Halfpenny landed his fourth penalty before the Blues also lost a man, when flanker Josh Navidi was shown the yellow card by Irish referee David Wilkinson. Edinburgh took full advantage and scattered the Blues pack at the resulting five-metre scrum and were awarded a penalty try.
Laidlaw added the conversion to bring Edinburgh within a point before he calmly slotted over a drop-goal with two minutes on the clock to clinch a well deserved win for the Scots.
Cardiff Blues: Leigh Halfpenny; Alex Cuthbert, Gavin Evans, Dafydd Hewitt, Tom James; Ceri Sweeney, Lewis Jones; Taufa'ao Filise, Rhys Williams, Benoit Bourrust, Bradley Davies, James Down, Josh Navidi, Sam Warburton, Andries Pretorius (capt).
Replacements: Marc Breeze, Nathan Trevett, Thomas Davies, Lou Reed, Luke Hamilton, Lloyd Williams, Rhys Patchell, Thomas Williams
Edinburgh: Greig Tonks; Lee Jones, Nick De Luca, John Houston, Tim Visser; Greig Laidlaw (capt), Richie Rees; Allan Jacobsen, Ross Ford, Geoff Cross, Grant Gilchrist, Sean Cox, David Denton, Roddy Grant, Stuart McInally.
Replacements: Andy Titterrell, John Yapp, Willem Nel, Perry Parker, Netani Talei, Chris Leck, Gregor Hunter, Sep Visser.
Referee: David Wilkinson (IRFU).
Assistant Referees: Sean Brickell, Jason Langdon (both WRU).
Citing Commissioner: Aurwel Morgan (WRU).
TMO: Neil Ballard (WRU).