Edinburgh wrecked Cardiff's Magners League housewarming party, collecting their fifth win in their last six visits to the Welsh capital - but only a touch of luck saved the visitors from last-ditch defeat in a game they dominated.
Former Wales captain Gareth Thomas burst through for a superb individual try, leaving full back Ben Blair, who had kicked immaculately all night, to convert and seal an unlikely victory in front of 8,125 fans at the new Cardiff City Stadium.
But the ball toppled over as he moved to kick and, without time to replace it, the New Zealander had to go through with his attempt, which sailed agonisingly the wrong side of the post.
In truth, it would have been more than the Blues deserved.
Edinburgh threw the ball around confidently from the start, while the Blues, after two disastrous home defeats in pre-season friendlies, lacked belief and their new fly-half, Australian Sam Norton-Knight, struggled to find his feet.
It was only stout defence by the home side which confined Edinburgh to two tries in a one-sided opening quarter.
Roddy Grant, the Scots’ go-to man in attack, was held up twice, before fellow flanker Alan MacDonald finally crossed at the posts for Chris Paterson to convert.
And, after Blair had kicked a close-range penalty to register the Blues' first competitive points at their new home, Edinburgh produced another fine move to create a second try.
Fly-half Phil Godman, the architect of most of their attacking play, found the giant Dutchman on the left wing, Tim Visser, who marked his debut with a touchdown.
The Blues finally showed some creativity of their own, back row duo Xavier Rush and Robin Sowden-Taylor taking them deep into the Edinburgh 22, before the ball was swung left.
It reached Chris Czekaj, who stretched over for a score awarded by Irish referee Peter Fitzgibbon without consulting the television official despite the fact replays suggested the winger’s foot may have strayed into touch.
Blair's conversion, along with two missed kicks by Paterson, meant the Blues were still in touch at the break.
It did not last; an inch-perfect cross kick by Godman was caught on the halfway line by winger Mark Robertson, who sent Paterson galloping 40 yards for an unconverted try.
Two Blair penalties sandwiched one by Paterson as the game lost its shape with the inevitable changes of personnel, until Thomas's touchdown set up the dramatic finale.