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
Live Text Commentary
Full Time The referee blows for the end of the match.90:00 +4:45
Craig Braham-Barrett concedes a free kick for a foul on Tommy O'Sullivan. Free kick taken by Stephen McPhail.90:00 +2:55
Waide Fairhurst takes a short corner.90:00 +0:54
Matthew Barnes-Homer is flagged offside by the assistant referee. Indirect free kick taken by Joe Lewis.87:56 Goal scored
Goal! - Matthew Barnes-Homer - Macclesfld 2 - 1 Cardiff Penalty taken right-footed by Matthew Barnes-Homer and scored. Macclesfield 2-1 Cardiff.87:17
Nathaniel Jarvis gives away a Penalty for an unfair challenge on Matthew Barnes-Homer.86:08
Matthew Barnes-Homer fouled by Adedeji Oshilaja, the ref awards a free kick. Pablo Mills takes the direct free kick.84:27
Assist by Jack Mackreth.84:27 Goal scored
Goal! - Matthew Barnes-Homer - Macclesfld 1 - 1 Cardiff Matthew Barnes-Homer finds the net with a goal from close in low into the middle of the goal. Macclesfield 1-1 Cardiff.82:10
Handball decision goes against Etien Velikonja. Free kick taken by Pablo Mills.81:44
The referee blows for offside against Etien Velikonja. Lance Cronin restarts play with the free kick.78:49
Shot from outside the penalty box by Jack Mackreth goes wide right of the goal.78:03
Outswinging corner taken from the left by-line by Peter Winn.77:53
The ball is delivered by Keiran Murtagh, clearance by Stephen McPhail.76:22
Effort on goal by Matthew Barnes-Homer from inside the box misses to the right of the target.75:02
Etien Velikonja produces a left-footed shot from the edge of the box and misses to the left of the goal.73:34
Matthew Barnes-Homer produces a right-footed shot from inside the area that goes over the bar.71:42
Free kick taken by Peter Winn.71:42 Substitution
Substitution Filip Kiss leaves the field to be replaced by Theo Wharton.71:42
Ben Nugent concedes a free kick for a foul on Matthew Barnes-Homer.
Substitution Waide Fairhurst on for Amari Morgan-Smith.69:22
Tommy O'Sullivan takes a shot. Lance Cronin makes a comfortable save.69:08
Filip Kiss takes a shot. Blocked by Pablo Mills.67:37
Peter Winn gives away a free kick for an unfair challenge on Etien Velikonja. Luke Coulson restarts play with the free kick.67:05
Adedeji Oshilaja concedes a free kick for a foul on John Paul Kissock. Free kick taken by Peter Winn.65:44 Substitution
Substitution Peter Winn is brought on as a substitute for Carl Martin.65:29
Pablo Mills has a shot and missed to the right of the target.65:02
Corner taken right-footed by John Paul Kissock.63:39 Substitution
Substitution Tommy O'Sullivan comes on in place of Kadeem Harris.62:39
Corner taken right-footed by John Paul Kissock from the left by-line to the near post, clearance by Stephen McPhail.61:59
Luke Coulson gives away a free kick for an unfair challenge on John Paul Kissock. Pablo Mills takes the free kick.60:06 Substitution
Substitution Jack Mackreth replaces Charlie Henry.58:57
Short corner taken by Kadeem Harris from the left by-line.58:45
Stephen McPhail takes a shot. Fantastic save by Lance Cronin.56:41 Substitution
Substitution Luke Coulson joins the action as a substitute, replacing Kevin McNaughton.56:41
Declan John provided the assist for the goal.56:41 Goal scored
Goal! - Nathaniel Jarvis - Macclesfld 0 - 1 Cardiff Nathaniel Jarvis fires in a goal from inside the six-yard box to the bottom left corner of the goal. Macclesfield 0-1 Cardiff.55:00
Foul by Amari Morgan-Smith on Joe Lewis, free kick awarded. Joe Lewis takes the direct free kick.54:27
Unfair challenge on Charlie Henry by Joe Ralls results in a free kick. Keiran Murtagh takes the direct free kick.53:12
Keiran Murtagh takes the free kick.53:12 Booking
Booking Booking for Kevin McNaughton.53:02
Kevin McNaughton is penalised for handball and concedes a free kick.52:36
Keiran Murtagh gives away a free kick for an unfair challenge on Nathaniel Jarvis. Nathaniel Jarvis restarts play with the free kick.50:24
Unfair challenge on Craig Braham-Barrett by Nathaniel Jarvis results in a free kick. Free kick taken by Lance Cronin.50:07
Charlie Henry delivers the ball, Joe Lewis makes a comfortable save.49:31
Corner taken right-footed by Charlie Henry from the left by-line to the near post, clearance by Stephen McPhail.48:59
Outswinging corner taken right-footed by Charlie Henry played to the near post, Ben Nugent makes a clearance.48:45
Amari Morgan-Smith takes a shot. Ben Nugent gets a block in.45:01
The game restarts for the second half.45:00 +1:07 Half time
Half Time The whistle is blown to end the first half.44:06
The referee penalises Amari Morgan-Smith for handball. Joe Lewis restarts play with the free kick.42:39
Stephen McPhail gives away a free kick for an unfair challenge on John Paul Kissock. Keiran Murtagh restarts play with the free kick.41:49
Ben Nugent gives away a free kick for an unfair challenge on Craig Braham-Barrett. Lance Cronin takes the direct free kick.41:08
Corner taken right-footed by Joe Ralls, clearance made by Pablo Mills.39:33
Joe Ralls produces a cross, clearance by Nathaniel Brown.38:31
Matthew Barnes-Homer is flagged offside by the assistant referee. Joe Lewis takes the indirect free kick.34:41
Shot by Charlie Henry from deep inside the penalty area misses to the right of the target.33:50
Foul by Ben Nugent on Amari Morgan-Smith, free kick awarded. Pablo Mills takes the direct free kick.32:00
Ben Nugent takes a shot. Comfortable save by Lance Cronin.31:37
Outswinging corner taken from the left by-line by Joe Ralls.27:06
The ball is sent over by Declan John.25:00
Joe Ralls takes a shot from a long way out which goes wide of the right-hand post.22:46
Unfair challenge on Nathaniel Jarvis by Carl Martin results in a free kick. Free kick taken by Declan John.22:13
Keiran Murtagh produces a right-footed shot from outside the penalty box and misses left.21:16
Sam Wedgbury challenges Stephen McPhail unfairly and gives away a free kick. Kevin McNaughton takes the free kick.19:23
Charlie Henry takes a shot. Joe Lewis makes a save.17:13
Ben Nugent challenges Matthew Barnes-Homer unfairly and gives away a free kick. Free kick taken by Keiran Murtagh.16:44
Centre by Amari Morgan-Smith, Ben Nugent makes a clearance.14:20
Stephen McPhail produces a shot on goal direct from the free kick.14:20 Booking
Booking Keiran Murtagh receives a caution.13:54
Free kick awarded for a foul by Keiran Murtagh on Filip Kiss.8:42
The ball is delivered by Joe Ralls.8:01
Short corner worked by Kadeem Harris.7:29
Free kick awarded for a foul by Carl Martin on Nathaniel Jarvis. Stephen McPhail takes the free kick.7:06
Shot from just outside the box by Keiran Murtagh misses to the left of the target.6:20
Corner taken by Charlie Henry from the left by-line played to the near post, clearance made by Stephen McPhail.3:49
Craig Braham-Barrett concedes a free kick for a foul on Kevin McNaughton. Adedeji Oshilaja restarts play with the free kick.1:50
Etien Velikonja challenges Sam Wedgbury unfairly and gives away a free kick. Direct free kick taken by Pablo Mills.1:36
Matthew Barnes-Homer takes a shot. Blocked by Ben Nugent.0:57
The referee blows for offside. Lance Cronin takes the indirect free kick.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers