The Republic of Ireland hit two late goals to snatch a dramatic but undeserved win over Kazakhstan in their opening World Cup qualifier in Astana.
James McCarthy went close for the Irish early on but the visitors lost their way badly and Kairat Nurdauletov nodded the home side ahead on 38 minutes.
A Republic defeat seemed inevitable before Robbie Keane's 89th-minute penalty appeared to have earned a draw.
However, sub Kevin Doyle volleyed in the winner a minute later.
Prior to Keane's levelling penalty, there was nothing in the second half to suggest that the Irish were going to end up with anything less than an ignominious defeat.
Before the goals, Giovanni Trapattoni's Irish side rarely threatened in the second half with their long-ball tactics proving totally ineffective.
Kazakhstan went into the game 142nd in the world rankings - 116 places below the Irish.
Trapattoni, 73, went into Friday's contest under some pressure with Shay Given and Damien Duff having unannounced their international retirements after the country's dismal showing at Euro 2012.
The Italian's playing hand for Friday's contest was also reduced by Darron Gibson's decision to withdraw his services from the squad following his non-involvement in Poland and the Ukraine.
The initial signs were promising on the artificial playing surface in Astana as McCarthy, making his competitive Irish debut, tested keeper Andrey Sidelnikov with a curling shot in the third minute.
Upcoming Rep of Ireland fixtures
- 11 Sept: Friendly v Oman (Craven Cottage)
- 12 Oct: World Cup qualifier v Germany (home)
- 16 Oct: World Cup qualifier v Faroe Islands (away)
Aiden McGeady then shot just wide from outside the box three minutes later after one of his typical jinking runs.
But in truth that was as it got for the Republic as they went into their shell for the next 83 minutes of action before the remarkable late turnaround.
With the Kazakhs sensing that the Irish were struggling, Tanat Nusserbayev and Heinrich Schmidtgal produced a series of attacking thrusts only to fail to deliver the final ball.
However, the home side took the lead on 38 minutes after Republic full-back Stephen Ward had needlessly conceded a free-kick in a dangerous position.
German-based Schmidtgal's brilliantly weighted deliverly was glanced to the net past Keiren Westwood by skipper Nurdauletov.
It could have been 2-0 three minutes later with Westwood making a great save to push away Ulan Konysbayev's drive with Nusserbayev judged offside as he hit the woodwork with the pointblank rebound.
Despite the dismal first-half showing, Trapattoni chose not to make any changes at the interval and it was more of the same for the Irish after the break.
The Republic boss finally acted just before the hour as Doyle replaced the ineffective Simon Cox but Kazakhstan were still bossing the game.
Baurzhan Jolchiyev should have extended the home side's lead in the 77th minute after charging clear of the Irish defence but Westwood stood tall to make a brilliant and vital save.
As the clocked ticked down, there was no hint that a late Republic rally might materialise.
But with a minute left, Doyle's cross from the left was sliced towards his own net by Mukhtar Mukhtarov which left Mikhail Rozhkov with little option but to bundle down Keane as the LA Galaxy striker looked set to nod home.
The Republic captain held his nerve to hammer his penalty past Sidelnikov for his 54th international goal as the Irish appeared to have snatched a hugely fortunate point.
But incredibly, there was yet more drama to come as Doyle volleyed home from close range a minute later after Ward's knock down.
The Irish players looked almost embarrassed at the final whistle as the home team wondered how they had managed to end up as losers.
The Republic's next qualifier will see them taking on Germany in Dublin on 12 October although Trapattoni's side face Oman in a friendly at Craven Cottage on Tuesday.
Sorry, we were unable to load match stats, please try again.
Live Text Commentary
Full Time The final whistle is blown by the referee.90:00 +3:28
Foul by Sergei Gridin on Darren O'Dea, free kick awarded. Keiren Westwood restarts play with the free kick.90:00 +1:51
Free kick awarded for an unfair challenge on Darren O'Dea by Bauyrzhan Dzholchiyev. Keiren Westwood takes the direct free kick.89:30
Assist by Stephen Ward.89:30 Goal scored
Goal! - Kevin Doyle - Kazakhstan 1 - 2 R Ireland Kevin Doyle grabs a goal from inside the area high into the middle of the goal. Kazakhstan 1-2 Rep of Ireland.89:05
Robbie Keane fouled by Mukhtar Mukhtarov, the ref awards a free kick. Glenn Whelan takes the direct free kick.88:13 Goal scored
Goal! - Robbie Keane - Kazakhstan 1 - 1 R Ireland Penalty taken right-footed by Robbie Keane and scored. Kazakhstan 1-1 Rep of Ireland.86:40
Unfair challenge on Robbie Keane by Mikhail Rozhkov results in a Penalty.83:36 Substitution
Substitution Sergei Gridin joins the action as a substitute, replacing Ulan Konysbayev.82:57
Kevin Doyle takes a shot. Mukhtar Mukhtarov gets a block in.82:10
Bauyrzhan Dzholchiyev is caught offside. Indirect free kick taken by Glenn Whelan.80:54
Unfair challenge on Mikhail Rozhkov by Robbie Keane results in a free kick. Andrey Sidelnikov takes the direct free kick.80:05
Corner from the right by-line taken by Stephen Ward, Darren O'Dea produces a header from close range which goes wide of the left-hand post.77:45
Outswinging corner taken by Aiden McGeady from the right by-line, Alexandr Kirov manages to make a clearance.77:27
Robbie Keane takes a shot. Mukhtar Mukhtarov gets a block in.77:04
The assistant referee signals for offside against Bauyrzhan Dzholchiyev. Sean St. Ledger takes the indirect free kick.76:26
Inswinging corner taken left-footed by Heinrich Schmidtgal from the right by-line, Sergey Ostapenko produces a right-footed shot from close in that clears the bar.75:51
Bauyrzhan Dzholchiyev takes a shot. Save by Keiren Westwood.75:06
Foul by Aleksandr Kislitsyn on Aiden McGeady, free kick awarded. Aiden McGeady takes the direct free kick.74:08
Free kick awarded for an unfair challenge on Heinrich Schmidtgal by John O'Shea. Free kick taken by Kairat Nurdauletov.
Glenn Whelan takes a shot. Andrey Sidelnikov makes a save.71:27
The referee blows for offside against Mukhtar Mukhtarov. Indirect free kick taken by Keiren Westwood.70:48
Ulan Konysbayev fouled by Stephen Ward, the ref awards a free kick. Direct free kick taken by Heinrich Schmidtgal.69:47 Substitution
Substitution (Rep of Ireland) makes a substitution, with Shane Long coming on for Jonathan Walters.67:44 Substitution
Substitution (Kazakhstan) makes a substitution, with Bauyrzhan Dzholchiyev coming on for Tanat Nusrbayev.67:44
Shot from long distance by Tanat Nusrbayev misses to the right of the goal.64:27
Unfair challenge on Darren O'Dea by Sergey Ostapenko results in a free kick. Direct free kick taken by Keiren Westwood.63:13
Sean St. Ledger concedes a free kick for a foul on Tanat Nusrbayev. Free kick taken by Aleksandr Kislitsyn.57:48
Unfair challenge on Aleksandr Kislitsyn by Stephen Ward results in a free kick. Heinrich Schmidtgal takes the free kick.56:55 Substitution
Substitution Kevin Doyle on for Simon Cox.55:41
Corner taken by Aiden McGeady, Mukhtar Mukhtarov makes a clearance.54:51
Free kick awarded for an unfair challenge on Aiden McGeady by Aleksandr Kislitsyn. The free kick is delivered right-footed by Aiden McGeady from left wing.48:59
Effort on goal by Ulan Konysbayev from just inside the penalty box goes harmlessly over the target.46:38
Unfair challenge on Sergey Ostapenko by Sean St. Ledger results in a free kick. Free kick taken by Kairat Nurdauletov.45:25
Jonathan Walters challenges Mikhail Rozhkov unfairly and gives away a free kick. Direct free kick taken by Andrey Sidelnikov.45:01
The referee blows his whistle to start the second half.45:00 +1:33 Half time
Half Time The ref blows to end the first period.45:00 +1:13
Free kick awarded for an unfair challenge on Heinrich Schmidtgal by John O'Shea. Free kick taken by Heinrich Schmidtgal.45:00 +0:41
Free kick awarded for a foul by John O'Shea on Andrey Sidelnikov. Free kick taken by Andrey Sidelnikov.44:25
Corner taken by Aiden McGeady from the left by-line.41:28
Tanat Nusrbayev takes a shot. Blocked by Sean St. Ledger.40:00
Anatoli Bogdanov fouled by Darren O'Dea, the ref awards a free kick. Heinrich Schmidtgal takes the direct free kick.37:08
The assist for the goal came from Heinrich Schmidtgal.37:08 Goal scored
Goal! - Kairat Nurdauletov - Kazakhstan 1 - 0 R Ireland Kairat Nurdauletov grabs a headed goal from deep inside the penalty area. Kazakhstan 1-0 Rep of Ireland.35:48
Free kick awarded for an unfair challenge on Ulan Konysbayev by Stephen Ward. Centre by Heinrich Schmidtgal,33:41
Inswinging corner taken by Aiden McGeady from the left by-line, Sean St. Ledger takes a shot. Save made by Andrey Sidelnikov.33:10
Ulan Konysbayev challenges Aiden McGeady unfairly and gives away a free kick. Stephen Ward takes the free kick.31:47
Corner taken right-footed by Aiden McGeady from the right by-line, clearance made by Alexandr Kirov.30:49
Unfair challenge on Aiden McGeady by Mukhtar Mukhtarov results in a free kick. Aiden McGeady crosses the ball from the free kick right-footed from left wing, Ulan Konysbayev makes a clearance.30:00
Direct free kick taken by John O'Shea.30:00 Booking
Booking Tanat Nusrbayev is shown a yellow card for unsporting behaviour.29:50
Tanat Nusrbayev challenges John O'Shea unfairly and gives away a free kick.27:51
Kairat Nurdauletov fouled by Aiden McGeady, the ref awards a free kick. Kairat Nurdauletov restarts play with the free kick.26:01
Free kick awarded for an unfair challenge on Jonathan Walters by Anatoli Bogdanov. Free kick taken by Aiden McGeady.24:13
Free kick awarded for an unfair challenge on Sergey Ostapenko by James McCarthy. Direct free kick taken by Mikhail Rozhkov.22:50
Foul by John O'Shea on Sergey Ostapenko, free kick awarded. Free kick taken by Heinrich Schmidtgal.22:04
Simon Cox has an effort at goal from deep inside the area missing to the left of the goal.19:53
James McCarthy concedes a free kick for a foul on Sergey Ostapenko. Heinrich Schmidtgal takes the free kick.18:54
Shot by Robbie Keane from deep inside the penalty area misses to the right of the goal.17:54
Aiden McGeady takes a shot. Blocked by Mukhtar Mukhtarov.16:19
Sergey Ostapenko gives away a free kick for an unfair challenge on James McCarthy. Keiren Westwood takes the free kick.14:23
Jonathan Walters is caught offside. Kairat Nurdauletov takes the free kick.13:43
Foul by Glenn Whelan on Anatoli Bogdanov, free kick awarded. Direct free kick taken by Anatoli Bogdanov.12:08
Jonathan Walters fouled by Mikhail Rozhkov, the ref awards a free kick. Free kick taken by Aiden McGeady.10:32
Unfair challenge on John O'Shea by Heinrich Schmidtgal results in a free kick. John O'Shea takes the direct free kick.7:35
Shot by Anatoli Bogdanov from outside the box goes over the target.5:34
James McCarthy produces a left-footed shot from just outside the box that misses to the right of the target.4:45
The assistant referee signals for offside against Mikhail Rozhkov. Keiren Westwood takes the direct free kick.3:52
Corner taken right-footed by Aiden McGeady.3:29
Outswinging corner taken right-footed by Aiden McGeady played to the near post, clearance by Aleksandr Kislitsyn.2:39
Corner taken by Aiden McGeady, Header from close in by Darren O'Dea misses to the right of the goal.2:26
Robbie Keane takes a shot. Save made by Andrey Sidelnikov.0:00
The game begins.
Live data and text provided by our data suppliers