Hungary saw their hopes of automatic Euro 2016 qualification put on hold as Greece finally stirred to claim a remarkable 4-3 victory in Piraeus.
Kostas Mitroglou and Panagiotis Kone struck in the last 11 minutes as the 2004 champions came from behind to win for the first time in their Group F qualifying campaign.
Hungary, who twice led in a pulsating game after two Krisztian Nemeth goals, had needed to win to stand any chance of pipping Romania to second spot but could still qualify automatically for Euro 2016 as the best third-placed team depending on results elsewhere. They are guaranteed a playoff spot.
Kostas Stafylidis got Greece off to a flying start, scoring their first home goal of the campaign as he turned in a cross from Stelios Kitsiou at close range in the fifth minute.
Daniel Bode volleyed narrowly wide for Hungary but the equaliser came after 26 minutes as Gergo Lovrencsics headed home a cross from Leandro.
Lovrencsics had another shot deflected narrowly over before Hungary went ahead after 55 minutes as Nemeth tapped in at the far post following a corner.
Greece quickly replied as Panagiotis Tachtsidis lashed in a powerful shot just two minutes later.
Nemeth put Hungary back ahead with his second 15 minutes from time after a fine run by Zsolt Kalmar, but again their joy was short-lived.
Mitroglou levelled with a cool finish after being played in by Tachtsidis and substitute Kone snatched a dramatic win as he met a Jose Holebas cross to thump in a powerful header.