A goal from Sergio Aguero and a late David Silva strike gave Manchester City a 2-1 victory at Hoffenheim as they bounced back from their opening Champions League defeat.
City, who had lost to Lyon in their first group game, were stunned in the opening minute as Kerem Demirbay found Ishak Belfodil, who ran clear to slip a low finish beyond Ederson.
But Aguero levelled only minutes later and then, with time running out, Silva found a winner for Pep Guardiola's side.
Hoffenheim continued their attacking momentum in the moments after Belfodil's goal, Joelinton firing in a cross which Ederson gathered.
But after eight minutes, City equalised when Leroy Sane found space on the left of the area and his cutback was controlled and fired home by Aguero.
Hoffenheium looked to hit back, Pavel Kaderabek racing into the area and going to ground under pressure from Kyle Walker, but his penalty appeals were waved away.
City's Nicolas Otamendi was booked for a crude challenge on Adam Szalai before his side came within a whisker of taking a 15th-minute lead when Raheem Sterling's strike was deflected wide.
The visitors were posing a constant threat on the break, Sane leading another rapid attack before Silva was driven wide by the final pass and his cross was blocked.
Hoffenheim were struggling to maintain possession when they did get the ball and, from another City break, Walker was denied by a well-timed challenge from Kaderabek.
And with 33 minutes gone Guardiola's side were almost in front, Sane's perseverance creating a difficult chance that Aguero hooked across goal and wide.
Aguero tried his luck again, a curling effort towards the top corner well saved by Oliver Baumann, before City's Fernandinho was booked for a foul as Hoffenheim mounted a foray forward.
Aymeric Laporte's loose backpass gave Belfodil a chance but his strike from an angle was beaten away and, with a couple of minutes until the break, Aguero was close again, a fizzing effort flying over.
Hoffenheim broke menacingly in the opening seconds of the second half, a low cross from Belfodil flying across the area before Florian Grillitsch lashed high from distance.
Laporte got away down the left and sent in a cross that was flicked wide by Silva before Hoffenheim made an early change, Adam Szalai replaced by Andrej Kramaric.
Hoffenheim's Kerem Demirbay was booked for fouling Silva, and then Sane found himself back in defence to clear after Ederson had raced out of his area and was stranded as Belfodil ran clear, the move following a City attack in which an Otamendi header was deflected away.
Shortly after the hour, John Stones came on for Otamendi as Guardiola made a change, and Walker went into the book for a heavy tackle on Kaderabek.
The second half was far more even than the first, City struggling to make the same headway and the home side more confident on the counter.
But Bernardo Silva almost conjured the goal that would have given the visitors the lead, crossing for Aguero whose header was clutched by Baumann.
Sane wanted a 73rd-minute penalty when Baumann came out to meet him as he tried to round him -- but the referee gave a goal-kick despite the Hoffenheim keeper appearing to bring him down.
Riyad Mahrez replaced Sterling as the game entered its final quarter of an hour, and a Sane pull-back evaded Aguero as the visitors generated some late pressure.
Grillitsch made way for Leonardo Bittencourt as Julian Nagelsmann freshened Hoffenheim up again -- but the Bundesliga side cracked with three minutes remaining, David Silva lashing past Baumann after Stefan Posch took too long to clear.