Andre Ayew's terrific late strike gave Swansea a 1-0 win over 10-man Brentford in the first leg of their Sky Bet Championship play-off semi-final.
Ayew, who had earlier seen his second-half penalty saved by David Raya, struck nine minutes from time at the Liberty Stadium with a ferocious volley from 16 yards.
The Ghana striker had actually started the move before getting on the end of an exchange of passes between Conor Gallagher and Jay Fulton.
Brentford had to play the final 25 minutes with 10 men after Rico Henry was shown a straight red card for a lunging tackle on Connor Roberts, although television replays suggested he did make some contact with the ball.
Two minutes earlier, Raya was the Bees' hero after saving Ayew's spot-kick, awarded when Pontus Jansson sent Rhian Brewster tumbling in the box.
Brentford had finished the Championship season three places and 11 points above Swansea, but the two teams came into the contest on the back of differing emotions.
Swansea secured the final play-off spot in unlikely fashion by winning 4-1 at Reading and profiting from a six-goal swing at the expense of Nottingham Forest, whom they finished level on points.
Brentford's shock home defeat to lowly Barnsley cost them automatic promotion and boss Thomas Frank said his squad had felt the pain of that setback.
But Brentford had beaten Swansea 6-1 on aggregate in their two league meetings, and Frank insisted that would count in the Bees' favour on a psychological level.
The visitors called the early tune with Said Benrahma heading wide and Ollie Watkins forcing a smart save from Erwin Mulder.
But Swansea slowly settled and Brewster, who has scored 10 goals since his January loan move from Liverpool, produced a stinging shot which Raya pushed away.
Watkins planted a header wide at the other end, but it was Swansea who finished the half on top and came closest to opening the scoring.
Ayew met a Gallagher corner with a header which cannoned off a post and Brewster almost bundled home the rebound as Raya grasped the ball on his line.
Brentford had the final word of an absorbing first period when Benrahma beat two defenders but sent his shot over Mulder's bar.
The game continued to fluctuate with Ayew meeting a Matt Grimes free-kick and forcing another Raya save and Brentford's Mathias Jensen driving wide after clever work from Watkins.
The caution count was also rising – Swansea defenders Ben Cabango and Jake Bidwell and Brentford pair Jensen and Henrik Dalsgaard going into referee Keith Stroud's notebook – as the tension began to grow.
Fulton, making his 100th appearances for Swansea, fired straight at Raya before Ayew's quick feet opened up the goal for a shooting opportunity which he placed just wide.
Henry's red card tilted the tie Swansea's way and Ayew – after holding his head following his spot-kick miss – made sure the Welsh side took a narrow advantage to Griffin Park on Wednesday with a strike to remember.