Taras Stepanenko gave Shakhtar a 51st-minute lead, but Porto – who ended up winning Group H by a five-point margin – equalised two minutes from time through Vincent Aboubakar.
Porto had already won the group after collecting 13 points from their first five games, but they still made the early running, with Evandro Goebel and Ricardo Quaresma both gaining half-chances.
Donetsk’s Yaroslav Rakitskiy then collected a yellow card, and Quaresma saw a left-footed shot from outside the penalty area saved by visiting goalkeeper Andriy Pyatov.
Pyatov was then forced into action again, saving low down from Adrian, but Porto lost Ruben Neves through injury as half-time approached, and he was replaced by former Feyenoord defender Bruno Martins Indi.
And it was Shakhtar that came up trumps to take the lead early in the second-half courtesy of Stepanenko, whose header found the top right corner of Porto’s goal.
There was little at stake for either team, yet Shakhtar produced some good football as they looked to preserve their narrow advantage.
But Porto were determined to end their group campaign without the disappointment of suffering a home defeat, and they duly came up trumps after 88 minutes.
And it was Aboubakar’s brilliant strike from outside the penalty area that hauled Porto level as they finished on an impressive 14 points, well clear of Shakhtar and the group’s other two teams Athletic Bilbao and BATE Borisov.