Hibernian have reached the Scottish Cup semi-finals after beating Kilmarnock in a six-goal encounter at Rugby Park.
Leigh Griffiths opened the scoring for Hibs before James Dayton levelled.
Matt Done regained the advantage for the visitors, but this was cancelled out by Paul Heffernan's penalty.
Griffiths grabbed a second, before Ross Barbour saw red for a pull on the striker, with a William Gros handball allowing Griffiths to score a last-minute penalty and claim a hat-trick.
Hibs join Celtic, Dundee United and Falkirk in Monday's draw for the last four.
Kilmarnock had the better of a scrappy opening to the game, but, despite winning free-kicks in promising areas, could not trouble the Hibs goal.
However, the talismanic Griffiths capitalised on a simple long ball from David Wotherspoon to slot the ball under Killie keeper Cammy Bell and claim his 20th goal of the season.
Killie put pressure on the Hibs defence in search of an equaliser, and the Ayrshiremen drew level when Dayton rifled home on the rebound after Hibs keeper Ben Williams had parried a long-range effort from Gros.
Griffiths at Hibs
Leigh Griffiths is in his second season on loan at Hibernian from Wolves. The 22-year-old former Livingston and Dundee forward has scored 33 goals in 68 games for the Edinburgh side
After a pattern of midfield deadlock, a disastrous mix-up between Bell and Sissoko left a loose ball at Done's feet 12 yards from an empty net, and the midfielder made no mistake.
Heffernan almost dragged his side level on the stroke of half-time, juggling the ball inside the Hibs box before rifling a volley inches past Williams' right-hand post.
The home defence continued to look jittery as the second half opened, and, after losing possession again, Griffiths waltzed into the box, but Bell scrambled his shot away.
Full-back Barbour broke forward for Killie, as the home side's play became more urgent, but his left-footed effort from a tight angle blazed wide of the mark.
New signing Kris Boyd had to wait to make his Killie return though, as Cillian Sheridan replaced McKeown.
The attacking gamble proved wise as Dayton forced a great save from Williams from a left-footed strike at the edge of the box.
However, the officials judged that Lewis Stevenson had bundled over Heffernan as he went for the rebound, and the striker lashed the penalty into the net.
Griffiths then passed up a great chance for Hibs, opting to shoot from a narrow angle with Done waiting in the six-yard box.
But the striker was not to be denied, outpacing Sissoko and robbing the ball from Bell's despairing grasp to slip the ball into the net.
The goal prompted Shiels to bring on Boyd, but the striker was unable to rescue the tie for the hosts.
Barbour saw red as the late drama continued, pulling back Griffiths in a dangerous position.
Then Gros handled as part of the defensive wall at the free-kick, giving Griffiths the chance of a hat-trick, which he claimed with an emphatic penalty strike.
Follow Stevie Miller on Twitter.
- 01 Bell Booked
- 02 Tesselaar (Boyd - 84' )
- 04 Fowler
- 23 McKeown (Sheridan - 65' )
- 25 Barbour Dismissed
- 88 Sissoko Booked
- 08 Clingan
- 10 Dayton
- 28 Winchester (O'Hara - 79' )
- 09 Gross Booked
- 14 Heffernan
- 17 Letheren
- 03 Hay
- 38 O'Hara
- 11 Boyd
- 12 Sheridan
- 01 Williams
- 03 McGivern
- 06 McPake
- 18 Maybury
- 08 Claros Booked
- 14 Wotherspoon
- 16 Stevenson Booked
- 17 Done Booked (Doyle - 79' )
- 20 Taiwo (Deegan - 79' )
- 28 Robertson
- 09 Griffiths (Harris - 90' )
- 31 Murdoch
- 37 Forster
- 07 Deegan
- 33 Harris
- 10 Doyle