Ian Madigan's last gasp penalty has secured a 22-19 win for Ulster against Edinburgh in the Guinness Pro14 semi-final.
Ulster trailed 17-7 with just 20 minutes at Murrayfield, but a stunning late comeback has set up a Pro14 final against Leinster next week at the Aviva Stadium.
Edinburgh made the better start, with Stuart McInally recording the game's first points with a 13th-minute try.
Captain McInally went over the whitewash after finding space from a lineout, but Jaco Van Der Walt's subsequent conversion flew wide of the posts.
Richard Cockerill's team continued to dominate the first half in both attack and defence, but did not add to their lead before the interval.
Edinburgh plundered their second try five minutes into the second half, with Darcy Graham going over brilliantly in the corner after good work from Chris Dean and a final pass from Van Der Walt.
Van der Walt nailed his conversion on this occasion, extending Edinburgh's lead to 12-0.
Rob Lyttle finally got points on the board for Ulster in the 53rd minute, finishing off a scintillating team move after excellent work from Billy Burns, Marcell Coetzee, Stuart McCloskey and James Hume. Burns converted to make it 12-7.
Edinburgh responded just three minutes later when Dean added their third try following a big carry from Hamish Watson. Van der Walt converted to extend the Scottish club's to 19-7.
Dan McFarland's bounced back five minutes later as Rob Herring went over after a Ulster maul from.a strong lineout. Burns missed his conversion, leaving Ulster trailing by seven points.
Substitute John Andrew registered Ulster's third try in the 75th minute, with the Ulster lineout providing an another opening deep in the Edinburgh half.
Madigan was faced with a difficult conversion, but the out-half's accurate kick drew Ulster level for the first time in the match.
Then, in the dying seconds, Ulster were awarded a penalty after an intentional knock-down from Mike Willemse.
Showing nerves of steel, Madigan's pinpoint kick - the last of the game - sailed between the posts to take Ulster to their first final in nine years.
Rob Herring and John Andrew