Germany put themselves in pole position in Nations League Group A4 heading into a crunch clash with Spain as Joachim Low's side came from behind to beat Ukraine 3-1.
Timo Werner scored either side of half-time following Leroy Sane's equaliser as Leon Goretzka turned in a dominant midfield display in Leipzig.
It was far from plain sailing for Germany on Saturday, however, with Andriy Shevchenko's depleted Ukraine side – who hit the post three times – taking a 12th-minute lead.
Goretzka set up two goals in the space of 10 minutes to give Germany the advantage by the interval and while defensive solidity evaded the hosts, Werner's second wrapped up the points.
One of four players to keep his place in Germany's starting XI, Philipp Max created two chances inside the opening five minutes, with Goretzka and Robin Koch failing to hit the target.
Yet Max was partly at fault as, against the run of play, Ukraine took the lead – the PSV defender's weak challenge enabling Oleksandr Zubkov to squeeze the ball back for Roman Yaremchuk to lash home.
Ukraine's lead lasted just 11 minutes, Goretzka robbing Oleksandr Zinchenko of possession before setting up Bayern Munich team-mate Sane, who arrowed a left-footed strike across Andriy Pyatov.
Goretzka had his second assist in the 33rd minute, crossing for Werner to head in from close range after getting on the end of Koch's delightful pass.
Ukraine were inches away from equalising early in the second half, as Zinchenko's deflected effort hit the upright.
Sane then sent a tame finish straight at Pyatov, but – after having a hopeful penalty appeal for handball dismissed – Germany had their third in the 64th minute.
Ilkay Gundogan fed Matthias Ginter, whose cross was swept home by Werner via a deflection. Marlos and Moraes did strike the woodwork at the other end, but the visitors failed to muster a comeback.