Shkodran Mustafi's goal gave the world champions the edge throughout the match and although Ukraine rallied before half time, Bastian Schweinsteiger's late second capped off a fine performance from Joachim Low's men.
The opening 45 minutes were played at a frenetic pace as both sides looked for goals, with Yevhen Konoplyanka forcing the first significant save out of Manuel Neuer as early as the fourth minute when the German stopper tipped the attacker's 25-yard strike away for a corner.
However, Ukraine failed to build on that and soon after Jonas Hector had volleyed over when well placed, Germany went in front when Mustafi rose above the defence to power home a header from Toni Kroos's set piece.
© Getty Images
Ukraine eventually responded with a Yevhen Khacheridi header that was tipped over by Neuer before Germany went up the other end through Sami Khedira, who volleyed straight at Andriy Pyatov after being found by a majestic ball from Kroos.
Andriy Yarmolenko had barely featured for Ukraine but with nine minutes of the first half remaining, he set up Konoplyanka inside the penalty area and although his effort was going wide, Jerome Boateng deflected it towards goal before producing a fine clearance off the line.
Germany started the second half with Julian Draxler testing Pyatov from distance and Kroos soon followed suit, only to see his strike go marginally over the crossbar.
Up the other end, Yaroslav Rakitskyi's free kick was parried wide by Neuer but Germany were soon back in the ascendancy with Khedira forcing another intervention from Pyatov.
Midway through the second half, Draxler sent a header over the bar before Thomas Muller was denied by Pyatov, but Germany could not find the second goal that would have put the result beyond doubt.
Mesut Ozil squandered a glaring chance after being played through on goal and he almost paid the price as Germany made problems for themselves at the back as the game entered added-on time.
However, they finally bagged a second in added-on time when Ozil crossed for substitute Schweinsteiger who volleyed home at the back post to take his team above Poland in Gro© AFPup C on goal difference.