League Two side Leyton Orient looked to have done enough to earn an FA Cup fourth round replay against Charlton, only for Jay Bothroyd's stoppage time free-kick to send the Premiership side through to round five by the skin of their teeth at The Valley.
Some 6,000 Orient fans had made the short journey across the river from east London, perhaps travelling more in hope than expectation of another cup shock, having dumped Fulham out in the last round.
And it was a bright start by the visitors, who pressed their top-flight opponents back in front of their own penalty area during the opening exchanges. However, no sooner had the League Two side settled into a rhythm, Charlton took the lead after seven minutes.
Captain John Mackie upended Darren Bent on the right touchline. From the resulting free-kick, Darren Ambrose sent over a low cross into the six-yard box, which went all the way through to defender Jonathan Fortune, who powered a flying header past Glyn Gardner.
The goal settled any nerves, and the hosts were soon stroking the ball around well. To their credit, though, Orient refused to lie down, and Shane Tudor sent an effort over the crossbar after making space for himself just outside the Charlton penalty area.
On 16 minutes, Ambrose whipped over another decent cross from the right after the visitors had failed to clear a corner. This time, though, Shaun Bartlett could only guide a glancing header past the far post.
On 35 minutes, Bent got clear down the right, and his centre was smashed wide by the advancing Ambrose. Radostin Kishishev then blasted over from the edge of the penalty area as Charlton stepped up the pace just before half-time.
At the other end, a long punt up field by Matthew Lockwood found its way through to Gary Alexander in the penalty area, but the striker's header was just off target.The in-form striker then flashed an effort over the crossbar having created space at the edge of the box, controlling the ball well on his thigh.
Orient were suddenly in the ascendancy. Lee Steele got in down the right, and took the ball on to the byline before cutting a pass back to Joe Keith.
His effort, from the penalty spot, was well struck - but cannoned off the bar and into the stands.
Another effort from Alexander flashed across goal just before the half-time whistle blew - much to the relief of Charlton manager Alan Curbishley, with more pressing matters than the England job now on his mind.
Following the restart, the visitors picked up where they had left off, with some anxious moments in the Charlton defence as Orient pressed.
And the League Two side were level after 53 minutes.
A slick move down the left involving Daryl McMahon and Keith release Steele into to area.
His low, angled shot was well struck, but really Thomas Myhre should have saved it at the near post. However, the ball slipped under his body and over the line - much to the delight of the amassed travelling support behind the goal.
With the tie suddenly very much alive, Charlton were being forced to fight for every ball, and needed to show more composure when in possession.
Curbishley had seen enough after 63 minutes - and made three changes; Jerome Thomas replaced Kishishev, Bothroyd came on for Bartlett and Alexei Smertin for Bryan Hughes.
England under-21 man Thomas looked hungry, having not played over the festive season because of a virus, and was soon in the thick of the action, driving an angled effort into the side netting.
After Bent seemed to have been bundled over by Michael Simpson in the area - although the referee did not think so - it needed a smart flying save from Garner to keep out Thomas' angled drive from the left.
McMahon headed straight at Myhre with 13 minutes left following a floating cross from Keith to the far post.
Charlton pressed, but too often chose the wrong option when in and around the penalty area.
Ambrose had a goal-bound effort hacked clear by Simpson, and then, just when Orient looked to have earned a deserved replay, a low 20-yard free-kick from Bothroyd took a slight deflection, which beat Garner in the cruellest of fashions during stoppage time.