Urko Pardo beat out Adriano's spot-kick on 11 minutes, but the Brazilian made amends by slotting home Vyacheslav Shevchuk's ball into the box on 62 and sub Seleznyov was in the right place to curl home after Pardo could only parry Fernandinho's fierce drive.
But it was the Cypriots who were celebrating at the whistle as they topped the group to cement their first-ever qualification for the last 16.
Manager Mircea Lucescu's men had already surpassed all expectations to become the first Cypriot side to qualify for the knockout stages, but the men from Nicosia wanted to go one step further to win Group G and avoid some of the competition's bigger guns.
In contrast, Shakhtar were already guaranteed bottom spot and without even a Europa League place to play for, it was uncertain how the Ukrainians would approach the match.
But any doubts were silenced by boss Mircea Lucescu's attacking line-up and there was an early shout for a penalty as Willian tumbled under Marcelo Oliveira's challenge on two minutes.
The Brazilian was again in the thick of the action with a shot that flew over Pardo's bar while APOEL could only boast a yellow card following Ivan Trickovski's blatant dive in the Shakhtar box.
And the visitors were handed a gilt-edged chance to take the lead on 11 minutes.
Nektariis Alexandrou's wild kick fouled Fernadinho and referee Hategan had no hesitation in pointing to the spot.
Adriano stepped up only for Pardo to guess right and palm the ball away while the Brazilian's attempt at a follow up was prevented by Sanel Jahic's desperate clearance over his own bar.
It was halfway through the first period before APOEL had a sight of Oleksandr Rybka's goal.
Constantinos Charalambides floated free-kick was pushed away by Rybka as Sanel Jahic rushed in with the Shakhtar defence static, but it was only a momentary respite.
Mkhitaryan tested Pardo and the keeper had to be alert again minutes later to block Willian's near post effort from Douglas Costa's defence-splitting ball.
Willian again stung Pardo's hands with a strike from the edge of the box, before Douglas Costa tried his luck with two quick-fire efforts. Pardo saved one and had the luxury of watching the second curl away to safety.
APOEL could have stolen the lead as the half came to a close from Marcinho's lay-off, but Trickovski found only Rybka who deflected the ball past the post.
Charalambides had a rare sight of the Shakhtar goal seconds after the restart but shot well over Rybka's bar and Savvas Poursaitides spared his blushes when he did just enough to put Mkhitaryan off his shot at the other end.
Shakhtar finally got their reward on 62 minutes.
Willian found Shevchuk on the overlap and his square ball was flicked home from close range by Adriano.
The Ukrainian side almost doubled their money in a matter of seconds when Pardo reacted instinctively to block Costa's flick before Adriano's follow up was blocked.
APOEL sub Tijnai Belaid made Rybka work down low to his left with a shot that would have found the inside of the post, but it was Shakhtar who again found the net.
Fernandinho let fly with a rasping 30-yarder that Pardo could only parry to sub Seleznyov who made no mistake to curl the ball inside the post.
That was the last real action of note as the game petered out to the accompaniment of smoke bombs as the Cypriot crowd celebrated their story-book march into the last 16, despite the defeat.
And while sterner tests await the side from Nicosia, no one could deny Jovanovic's side their moment in the sun.
- Related links