The Europa League holders are in big trouble in the competition as a second defeat on the road sees their hopes of qualification to the knockout stages continue to fall
A late Manduca goal gave the hosts the three points, just moments after Hulk's penalty had cancelled out Ailton's first-half finish from the spot.
The match started at a slow pace with both sides looking more interested in not conceding than going out to attack. As such, it was with little surprise that the first opening came 21 minutes into the game. Manduca delivered a cross into the six-yard box for Ailton, whose header was denied by Helton.
With Porto struggling to create any chances APOEL looked more lively and broke the deadlock three minutes before the half-time break.
Ailton was tripped by Eliaquim Mangala as he tried to dribble past the Belgian defender and the referee immediately signalled a penalty. The Brazilian striker stepped up and sent the keeper the wrong way to the delight of home supporters, scoring his third goal in the competition.
It was expected that Porto coach Vitor Pereira would make some changes during the interval, but it took him 15 minutes in the second half to react, as Freddy Guarin and James Rodriguez came on for Fernando and Silvestre Varela.
The substitutions paid immediate dividends as the visitors upped the pace and created some opportunities but their shots from distance were either blocked by APOEL defenders or calmly saved by the goalkeeper.
As the game wore on APOEL took control of possession, trying to kill off the game on the counter, but Porto won a penalty in the 88th minute after Rodriguez was brought down in the area by Nuno Morais. Hulk made no mistake from the spot and equalised for the visitors.
The parity lasted just two minutes, though, as APOEL regained the lead through Manduca. Porto pushed forward in search for an equaliser and left plenty of space at the back, allowing Constantinos Charalambides to send in a pass to the far post for the Brazilian to slot home.
The victory sees APOEL remain at the top in Group G, on eight points, while Porto are third, with four points fewer.