Celtic manager Neil Lennon praised his side for a "dominant" display as they edged past Riga FC to reach the Europa League play-off round.
Lennon's side toiled to create at times against the Latvian champions.
But with two minutes left, Jeremie Frimpong crossed for substitute Mohamed Elyounoussi to steer in his third goal of the season and prevent extra-time.
"I felt the performance thoroughly merited the win," said Lennon, whose side face Sarajevo next Thursday.
"It's the first time Riga have lost here in a European tie, so big kudos to the players on that one.
"We had to be patient, left it a little bit late, but we should've had the game wrapped up a lot earlier."
Lennon's primary emotion will be relief, after a painfully one-paced display in the Latvian capital against a stuffy Riga side.
The Celtic manager alluded to their hosts' defensive solidity before the game, and urged patience from his players.
And though Riga sat deep in a compact 4-4-2 as expected, he would have been alarmed at just how little his side managed to create initially.
Nir Bitton wasted the best chance of the first half when he scuffed his effort from 10 yards out, and Ritvars Rugins managed to cut out Callum McGregor's ball to deny Frimpong a tap-in.
Riga rarely threatened or even ventured forward, but they were excellent at stifling Celtic. They might have been prepared for a second-half onslaught from their visitors, but it never materialised to the degree expected.
Ryan Christie had a surge and shot easily saved and substitute Albian Ajeti twice came within inches of turning in two Frimpong crosses from just three yards out, only for Herdi Prenga to twice scramble the ball clear on both occasions.
But just as extra-time seemed inevitable, Frimpong again showed his prowess with a terrific run and cross for Elyounoussi to edge Celtic into the play-off round.
The Scottish champions may be without James Forrest for that tie, who limped off with bone bruising in the first half and will miss Sunday's match with Hibernian.
Man of the match - Jeremie Frimpong
What did we learn?
If not already evident, it was clear from this display that Celtic are yet to get anywhere near the attacking fluidity they showed at the start of 2020.
The midfield trio of Scott Brown, McGregor and Olivier Ntcham struggled to create tempo, and the returning Odsonne Edouard was miles from his best and cut a frustrated figure up front.
Frimpong, who started on the bench, was their best attacking outlet from right wing-back, causing problems with his searing pace and clever deliveries, which in itself will give Lennon food for thought.
What they said:
Celtic manager Neil Lennon on Frimpong: "He's not been at that level so far this season but we've seen this week him starting to show glimpses of it. He looked far more dynamic, purposeful.
"He put a great cross in for the goal, he can be thrilled with his performance because it's not easy doing what he does."
Celtic host Hibernian in the Scottish Premiership on Sunday (15:00 BST) as they aim to maintain pace with Rangers at the top of the table.
- 32Natã WachholzSubstituted forBezerra Brisolaat 71'minutes
- 33KamessBooked at 69mins
- 27DebelkoSubstituted forMilosevicat 67'minutesSubstituted forN'Kololoat 90+1'minutes
- 10Rodrigues Figueira
- 7Bezerra Brisola
- 4DuffyBooked at 70mins
- 49ForrestSubstituted forFrimpongat 34'minutes
- 8BrownBooked at 40mins
- 21NtchamSubstituted forAjetiat 72'minutes
- 22EdouardSubstituted forElyounoussiat 82'minutes
- Fábio Veríssimo
- Shots on Target