Trent Alexander-Arnold scored his first Liverpool goal as Jurgen Klopp's side took a 2-1 lead in their Champions League qualifier against Hoffenheim.
Alexander-Arnold curled home a fine free kick in the first half after the hosts had a penalty saved, with an own goal from Havard Nordtveit after the break doubling the lead before Mark Uth drilled home to put the Bundesliga side back in contention.
In a bright start by the visitors, Alexander-Arnold played a pass through to Mohamed Salah, who turned inside the area but was crowded out.
But the home side quickly asserted themselves and a dangerous cross from Andrej Kramaric was intercepted by Joel Matip before Dejan Lovren cleared another curling delivery.
They had -- and missed -- a golden chance to go in front when Serge Gnabry was bundled over in the area by Lovren, only for Kramaric's weak spot-kick to be stopped by Simon Mignolet.
Hoffenheim could have paid for that profligacy within moments when a Kevin Vogt mistake allowed Salah to run in on goal, only for the Liverpool man to side-foot wide of the near post.
As the game approached the 20-minute mark, Jurgen Klopp's side conjured a threat of their own and Alexander-Arnold was again involved, firing in a cross that brought a Liverpool corner.
The hosts hit back, Liverpool suffering some defensive uncertainty before Pavel Kaderabek scuffed wide from 12 yards, and then Matip blocked when Kramaric struck after patient build-up play.
But they were behind with 35 minutes gone when Alexander-Arnold, the visitors' most positive player, steered a free kick over the wall and into the corner after Sadio Mane had been fouled by Ermin Bicakcic 25 yards out.
Lifted, Liverpool came forward again and Emre Can saw a long-range effort stopped by goalkeeper Oliver Baumann -- but they were almost pegged back when Mignolet blocked from Kramaric and Wagner's rebound hit the post.
Liverpool, though, were within a whisker of doubling their lead in the closing seconds of the half when Lovren powered a header goalwards from a corner but saw it go fractionally wide.
Hoffenheim began the second period brightly, but it was Liverpool who engineered a glorious chance to score a second when Mane whizzed down the left and crossed for Firmino, who blasted straight at Baumann.
Mane was in the thick of it again when he wriggled away from Ermin Bicakcic and forced Baumann into action with a fierce attempt from an angle.
Around the hour mark, the home side won a succession of corners but Liverpool stood firm and withstood another moment of danger when the ball fell to Gnabry but he was unable to steer his effort on target.
Klopp made a change, bringing on James Milner for Jordan Henderson, with Milner taking the captain's armband, and saw his side again come close with 20 minutes remaining as Baumann blocked Salah's strike from an angle.
Liverpool were taking charge and Lovren rose to meet another corner, with Baumann saving, as Hoffenheim began to look as though they were running out of ideas.
With 74 minutes gone the hosts got the second goal they had been threatening, Milner getting down the right and his attempted cross taking a deflection off substitute Nordtveit and looping into the far corner.
Liverpool threatened to grab a third as the game entered its final 10 minutes, Firmino's dangerous low cross cut out by Baumann -- but Hoffenheim kept their hopes alive with three minutes left when Uth chested down a long pass and thumped a finish beyond Mignolet.
And they almost made it 2-2 in the closing when Liverpool's marking fell apart from a free kick -- but Benjamin Hubner sent a free header over the top.