Lincoln City became the first non-League side to reach the quarter-finals of the FA Cup since 1914 as Sean Raggett's 89th-minute header sunk Burnley 1-0 at Turf Moor.
Andre Gray passed up the Premier League side's best opportunity shortly after half-time but Sean Dyche's men were forced to endure a sustained spell on the back foot during the second period against the National League leaders.
They appeared to have weathered the storm as Ashley Westwood, Michael Keane and Scott Arfield all spurned presentable opportunities inside the final 10 minutes but 23-year-old centre-back Raggett, who was also on target in a more low-key round-two win over Altrincham in November, provided a magical sting in the tail in front of 3,000 disbelieving travelling supporters.
Lincoln should have taken a fifth-minute lead when Nathan Arnold – their matchwinner in round three against Ipswich Town – made the most of a haphazard Burnley offside trap to play in Jack Muldoon to sky wastefully over.
Burnley lost Johann Berg Gudmundsson to injury after a poor tackle from Alan Power but were in the ascendancy as the interval approached, with Arfield clattering beyond the crossbar following fine hold-up play from James Tarkowski.
Gray found room at the near post to meet Joey Barton's 52nd-minute free-kick from the left but badly miscued his volley.
Barton's more regrettable tendencies then came to the fore - catching Power with an elbow, throwing himself to the floor under minimal provocation from Matt Rhead and capping an absurd passage of individual play with a booking after an altercation with Terry Hawkridge.
Lincoln could not turn their pressure into clear chances at that stage and were grateful to see goalkeeper Paul Farman thwart Westwood in a goalmouth scramble before Keane headed a corner off target at the back post and Arfield failed to reward fine work by Gray with a wayward slice.
They were misses that would haunt Burnley, much like their defending on the winner will deeply trouble Dyche.
Luke Waterfall was left completely unmarked to nod a corner back across goal and, although Tom Heaton pushed Raggett's header away, he was behind the line when he did so.
Heaton found himself up in the Lincoln area after opposite number Farman brilliantly saved from Gray but Danny and Nicky Cowley's Lincoln heroes would not be denied.