Champions League surprise package APOEL Nicosia suffered their first defeat of the campaign tonight but still qualified as Group G champions.
Second-half goals from Luiz Adriano, who had earlier missed a penalty, and substitute Yevgen Seleznev earned Shakhtar Donetsk their first win in this season's tournament.
But a goalless draw in the group's other game, between Zenit St Petersburg and Porto, meant the Cypriots topped the group by virtue of their superior head-to-head record against fellow qualifiers Zenit.
Shakhtar started strongly and Willian shot over before he and Fernandinho were both denied by blocks from Paulo Jorge.
Marcelo Oliveira then blocked Vyacheslav Shevchuk's left-foot strike before the Ukrainians had their best chance yet to break the deadlock when Nektarios Alexandrou brought down Fernandinho in the penalty area.
The defender was booked but Luiz Adriano could not inflict further punishment, his weak penalty easily blocked by keeper Rafael Urko before Sanel Jahic got back to keep out the striker's follow-up.
Urko fumbled Henrikh Mkhitaryan's 25-yard shot but did well to twice deny Willian, and then held Douglas Costa's fierce drive to keep his side on terms.
They finally mustered an attacking threat of their own with five minutes of the half remaining when Ivan Trickovski's shot was superbly saved by Olexandr Rybka in the Shakhtar goal. Rybka punched the resulting corner back to the set-piece taker, Marcinho, who shot over from 25 yards.
The second half began with Shakhtar forcing a free-kick and laying the ball to Konstantinos Charalambidis, who shot over.
Mkhitaryan dragged a shot across the face of goal and a Jahic block denied Douglas Costa before Paulo Jorge again put his body on the line to keep out Fernandinho.
But the breakthrough finally came in the 62nd minute, Shevchuk squaring for Luiz Adriano to find the net.
The pressure did not let up as Mkhitaryan and Douglas Costa both tried their luck from 20 yards, the latter warming Urko's hands.
But Olexander Kucher had to be alert to clear Trickovski's effort and Yaroslav Rakitskiy then kept out substitute Tijani Belaid's shot to deny APOEL an equaliser.
Willian and Trickovski failed with 20-yard efforts before Shakhtar wrapped the game up. Fernandinho's 30-yard effort was parried by Urko but Seleznev followed up to stroke the ball home from 12 yards.
APOEL could not muster a response but nevertheless topped the group after Zenit's stalemate.