Match ends, Videoton 1, The New Saints 1.
Adam Gyurcso's extra-time goal knocked The New Saints out of the Champions League second qualifying round.
Matty Williams's 78th-minute goal had shocked Hungarian champions Videoton and taken the game into extra time.
But Gyurcso - who scored the only goal in the first leg last week - gave the home team a 2-1 aggregate win.
Saints striker Mike Wilde missed a late chance, and then Sam Finlay was sent off following an off-the-ball incident in the final minutes.
Videoton started the match as firm favourites following their 1-0 win at Park Hall.
TNS are the only full-time professional team in the Welsh Premier League and were aiming to equal their best showing in Champions League when they reached the third qualifying round in 2011.
With temperatures well above 30C, goalkeeper Paul Harrison denied Dinko Trebotic and Mirko Ivanovski while at the other end Wilde had a header cleared off the line.
When substitute Williams swept in Simon Spender's cross from the right wing, it took the game to an extra 30 minutes.
Both teams slowed down in the heat during extra time, and it took a rare moment of quality from Gyurcso to finally beat Harrison and end the Saints' dream.
Finlay was shown the red card two minutes from the end as tempers frayed.
In the next round Videoton will face Belarus champions BATE Borisov, who beat Dundalk 2-1 on aggregate.
TNS manager Craig Harrison said: "The players were outstanding tonight. We worked out where their weaknesses would be and where our strengths would be and the lads were absolutely outstanding, every single one. I think we have been very very unlucky."
- 23JuhászSubstituted forSouza dos Santosat 67'minutes
- 4LuijckxSubstituted forSimonat 87'minutes
- 33TreboticBooked at 16mins
- 16OliveiraBooked at 88mins
- 19IvanovskiSubstituted forKovácsat 57'minutes
- 3Souza dos Santos
The New Saints
- 8FinleyBooked at 118mins
- 7SeargeantSubstituted forWilliamsat 73'minutes
- 23EdwardsBooked at 93mins
- 14MullanSubstituted forDraperat 110'minutes
- 21CieslewiczSubstituted forQuigleyat 67'minutes
- Pawel Raczkowski
Second Half Extra Time ends, Videoton 1, The New Saints 1.
Sam Finley (The New Saints) is shown the red card for a bad foul.
Substitution, The New Saints. Greg Draper replaces Jamie Mullan.
Goal! Videoton 1, The New Saints 1. Adam Gyurcsó (Videoton) right footed shot from outside the box to the top left corner.
Second Half Extra Time begins Videoton 0, The New Saints 1.
First Half Extra Time ends, Videoton 0, The New Saints 1.
Aeron Edwards (The New Saints) is shown the yellow card.
First Half Extra Time begins Videoton 0, The New Saints 1.
Second Half ends, Videoton 0, The New Saints 1.
Filipe Oliveira (Videoton) is shown the yellow card.
Substitution, Videoton. Ádám Simon replaces Kees Luijckx.
Goal! Videoton 0, The New Saints 1. Matthew Williams (The New Saints) right footed shot from outside the box to the centre of the goal.
Substitution, The New Saints. Matthew Williams replaces Chris Seargeant.
Substitution, Videoton. Paulo Vinicius replaces Roland Juhász.
Substitution, The New Saints. Scott Quigley replaces Adrian Cieslewicz.
Substitution, Videoton. István Kovács replaces Mirko Ivanovski.
Second Half begins Videoton 0, The New Saints 0.
First Half ends, Videoton 0, The New Saints 0.
Dinko Trebotic (Videoton) is shown the yellow card.