Dion Dublin's last-minute strike sent Charlton crashing out of the FA Cup as Leicester earned a place in the quarter-finals.
The visitors had taken the lead 38 minutes in when an unmarked Nikos Dabizas headed home from close range.
But the home side found the equaliser just before the break, Shaun Bartlett tapping in Paul Konchesky's cross.
Then with less than a minute of regular time left, Dublin headed in Gareth Williams' corner for a famous victory.
Charlton found little consolation in home advantage early on as they struggled to find their rhythm against a side a division below them.
Such was their frustration that Addicks boss Alan Curbishley made a concerned appearance on the touchline less than 20 minutes in.
He was right to worry as Leicester produced the first chance of the game when Alan Maybury took advantage of a confused Charlton defence to slip into the box and shoot wide.
At the other end, a fine one-handed save from Ian Walker was enough to deny Bryan Hughes' excellent right-footed volley 33 minutes in.
But Leicester's goal finally came five minutes later when Dabizas was allowed to wander unmarked into Charlton box and head home Joey Gudjonsson's free-kick.
The celebrations were short-lived as Charlton attacked with fresh vigour and were rewarded with Bartlett's close-range equaliser from a Paul Konchesky cross on the stroke of half-time.
Keith Gillespie nearly renewed the Foxes' lead four minutes after the break when his firm header was saved by Addicks keeper Dean Kiely.
But it was to be a frustrating day for the winger, who later had to leave the pitch to receive treatment for a head cut and then was booked on his return for a foul on defender Hermann Hreidarsson.
Bryan Hughes also came close for Charlton but both sides threatened only sporadically as time ticked away.
With 10 minutes to go, Leicester nearly found the winner when a desperate Addicks defence were forced to clear off the line after a goalmouth scramble.
However, both sides continued to battle away in vain until the 90th-minute when defender Dublin leapt high in the box to produce a dramatic upset at The Valley.
Charlton boss Alan Curbishley:
"I couldn't believe how lacklustre we were but I don't want to take away from Leicester.
"They looked a bit hungrier than us and we looked second-best in many areas. They were quicker, sharper and I think they sensed victory.
"I hope they get a good draw because they deserve it."
Leicester City boss Craig Levein on Dublin:
"He's been magnificent since he arrived at the club. He can play at the front, the back and I'm sure if I asked him he'd play midfield as well.
"All credit to Dion he scored right in front of our supporters.
"It was perfect for us - I thought we played well at a place where it's extremely difficult to win and I thought we deserved it."
Charlton: Kiely, Young, El Karkouri, Fortune (Johansson 70), Hreidarsson, Rommedahl (Thomas 45), Murphy, Holland, Hughes (Euell 79), Konchesky, Bartlett.
Subs Not Used: Andersen, Perry.
Goals: Bartlett 45.
Leicester: Walker, Maybury, Dabizas, Dublin, Stewart, Gillespie, Hughes (Nalis 82), Williams, Gudjonsson, Tiatto, de Vries (Connolly 85).
Subs Not Used: Hirschfeld, Canero, Heath.
Booked: de Vries, Gillespie.
Goals: Dabizas 38, Dublin 90.
Ref: P Walton (Northamptonshire).