Non-league Macclesfield reached the fourth round of the FA Cup for the first time as two late goals saw off Championship leaders Cardiff City.
A weakened Cardiff side looked to be heading through as they protected Nat Jarvis's second-half opener.
But Matthew Barnes-Homer equalised with five minutes to go for the Conference side, converting Jack Mackreth's cross.
He then secured a famous win from the penalty spot after Jarvis was penalised for pulling the shirt of Pablo Mills.
There was little sign of the late drama at Moss Rose as Blue Square Bet Premier outfit Macclesfield failed to pressurise Cardiff's youngsters in the closing stages.
But top scorer Barnes-Homer, anonymous until then, showed his scoring instincts to deliver one of the major shocks of this year's third round.
With promotion the clear priority for the visitors, manager Malky Mackay had promised changes - and he made 11.
- Blue Square Bet Premier side Macclesfield are 81 places below Championship leaders Cardiff in English football's pecking order
Experienced midfielder Stephen McPhail captained the side, making his first appearance since a Capital One Cup defeat at Northampton on the opening day of the season.
Four other members of that side also started, while Kadeem Harris made his debut, almost a year since joining from Wycombe Wanderers.
But the gamble seemed to have paid off as two of those youngsters combined well to give the visitors the lead after 57 minutes.
Left-back Declan John showed great pace to reach Joe Ralls's pass and deliver a tempting ball across the face of goal from the bye-line.
Jarvis, recently returned from a loan spell at Conference side Forest Green, was alert to prod the ball home for his first FA Cup goal on his debut for Cardiff in the competition.
The visitors grew in confidence and started to establish a semblance of control. Etien Velikonja almost doubled the lead when home goalkeeper Lance Cronin rushed off his line but his volley from a tight angle sailed across the face of goal.
The game then turned on its head, leaving Cardiff little time to find a response.
Substitute Mackreth crossed deep to the far post at the second attempt and Barnes-Homer was perfectly placed to pounce.
The home celebrations were still in full swing when referee Andrew Madley punished Jarvis for pulling Mills's shirt in the area and Barnes-Homer converted confidently from the spot.
- 01 Cronin
- 05 Brown
- 22 Braham-Barrett
- 31 Martin (Winn - 66' )
- 34 Mills
- 08 Murtagh Booked
- 17 Wedgbury
- 18 Henry (Mackreth - 61' )
- 19 Kissock
- 09 Barnes-Homer
- 10 Morgan-Smith (Fairhurst - 71' )
- 13 Mills
- 14 Diagne
- 07 Mackreth
- 16 Konadu-Yiadom
- 11 Winn
- 20 Fairhurst
- 28 Gnahoua
- 32 Lewis
- 02 McNaughton Booked (Coulson - 58' )
- 31 Nugent
- 35 Oshilaja
- 04 Kiss (Wharton - 72' )
- 19 Harris (O'Sullivan - 64' )
- 21 Ralls
- 37 McPhail
- 42 John
- 09 Velikonja
- 33 Jarvis
- 29 Parish
- 40 Coulson
- 44 Mansaray
- 38 O'Sullivan
- 45 Wharton
- 34 Darco
- 43 Hill