Simon Church dashed Sheffield Wednesday's hopes of an FA Cup derby clash with Sheffield United by heading Charlton into the last eight at Hillsborough.
The Wales international headed home captain Johnnie Jackson's 65th-minute free-kick after Wednesday forward Leon Best had cancelled out Callum Harriott's first-half opener for the Addicks.
All of Sheffield had been hoping Wednesday would see off the London side to set up the first Steel City derby in the FA Cup since the famous Wembley semi-final against Sheffield United in 1993.
But Chris Powell's Sky Bet Championship relegation battlers were reading from a different script and instead booked their own place in the sixth round for the first time since 2006.
But it took a breathtaking stoppage-time save from Charlton goalkeeper Ben Hamer, who hurled himself at Chris Maguire's deflected shot to turn the ball away from the top corner, to deny Wednesday a replay.
Wednesday, who made six changes to the side that won 2-0 at Huddersfield on Saturday, were fortunate not to go behind in the 12th minute when a shot from Astrit Ajdarevic, the Standard Liege midfielder signed on loan last month, rolled agonisingly wide.
Charlton boss Powell had also rejigged his starting line-up, with five new faces added to the team that clinched a 1-0 home win against QPR, but the Londoners' tails were up after that surprise and their early enterprise was justly rewarded in the 21st minute.
Ajdarevic played the ball into the penalty area and after it came back off a Wednesday defender, Harriott smashed home the rebound on the volley from 15 yards.
It was one-way traffic and visiting midfielder Jordan Cousins soon forced a smart near-post save from Wednesday goalkeeper Damian Martinez.
Wednesday's on-loan Aston Villa midfielder Gary Gardner crashed in a 25-yard effort that Hamer did well to hold shortly before the interval.
Another Wednesday loanee, Blackburn striker Best, lifted the Hillsborough faithful further with a dipping volley from similar distance soon after as the home side at last rose to the challenge.
Wednesday began the second half full of purpose heading towards the kop and, although Jackson rifled a low shot just wide, the hosts drew level in the 57th minute.
Maguire's free-kick into the area was headed down by Wednesday defender Miguel Llera and, from 10 yards, Best fired home his first goal for the club since arriving last week from Ewood Park.
But parity was short-lived. Llera was penalised for obstructing Church and, from Jackson's subsequent free-kick, the former Reading forward stole in unmarked to head beyond Martinez in the 65th minute.
Wednesday thought they had equalised for a second time seven minutes later when Llera's header hit the inside of the post and bounced straight into the fortunate Hamer's clutches.
The visitors enjoyed more good luck in the 88th minute when Best shot straight at team-mate Atdhe Nuhiu after a goalmouth scramble and, after former Wednesday defender Richard Wood was booked for his blatant foul on Nuhiu, more frantic defending from the visitors prevented a late equaliser following Maguire's free-kick.
Maguire's stoppage-time effort appeared destined for the top corner after taking a slight deflection, but Hamer pulled off a terrific save to keep the Yorkshire o outfit at bay.