Greece survived a major scare in Tbilisi to book their place in Euro 2012.
Top of the group heading into the game, Fernando Santos' side needed only a point to ensure their presence in Poland and Ukraine.
But they trailed for an hour to David Targamadze's free-kick and needed two goals in the final 11 minutes from Giorgos Fotakis and Angelos Charisteas to turn the game around.
The hosts took a shock lead in the 19th minute when Kyriakos Papadopoulos fouled Levan Mchedlidze and Targamadze's left-wing free-kick sailed straight into the far top corner.
Theofanis Gekas wasted an opportunity to equalise from close range before a double chance passed Greece by in the 28th minute.
Kostas Katsouranis' 20-yard shot was parried by keeper Nukri Revishvili and the ball was crossed back into the box by Loukas Vyntra to Gekas, who fired over from 12 yards.
Revishvili tipped Vyntra's powerful 20-yard drive around the post and Katsouranis was off target with a hopelessly ambitious effort as the visitors still trailed at the interval.
Targamadze, emboldened by his goal, tried his luck from extreme range again but this time Greece keeper Alexandros Tzorvas parried the shot away.
Angelos Charisteas responded with a shot wide, and Revishvili had to be alert to turn away Giorgos Karagounis' free-kick.
The equaliser finally arrived when, following a corner from Katsouranis, Fotakis let fly from 30 yards and found the roof of the net.
That put Greece back in position to qualify automatically, and Katsouranis then set up Charisteas to fire home the winning goal from the left of the penalty area with five minutes remaining.