Raith Rovers suffered Scottish Cup heartache as they failed to cause the upset many predicted in an agonising defeat to Livingston.
Jack Hamilton gave Raith a dream start with the breakthrough after just four minutes in a whirlwind opening from the visitors.
Livi, rock bottom of the Premiership and without a win in 13 games, passed up the chance to level when Andrew Shinnie missed a 20th-minute penalty.
But the hosts did restore parity when Jamie Brandon rattled in his first goal for the club in the 32nd minute.
And, with Rovers pushing hard for the winner, Dan MacKay nodded in the clincher at the other end with eight minutes remaining in regulation time.
Team shake-up
Ian Murray was able to call on keeper Kevin Dabrowski again after he missed the defeats to Airdrie and Queen’s Park with a thigh injury.
Also back in the starting line-up after a suspension was Ross Millen.
The right-back lined up in an usual three-man defence as Murray reprised the formation that worked so well in the last round against Dunfermline.
Dylan Corr, Dylan Easton and Andy McNeil were the players who made way.
Raith catch hosts cold
There was only a minute on the clock when Raith threatened an early breakthrough.
Lewis Vaughan’s low cross tried to pick out Hamilton inside the six-yard box but Livi got enough of a presence around the striker to snuff out the danger.
A minute later, they came closer.
Kyle Turner’s lofted pass was nodded down by Hamilton and Shamal George had to look smart to block Vaughan’s close-range effort.
Then came the opener they craved after just four minutes.
Ross Millen launched a long pass forward that picked out Hamilton. The striker was allowed to chest the ball down and his drilled shot went under George’s dive to find the net.
Let-off for Rovers before Lions roar back
Livi’s opportunity to level midway through the first-half was self inflicted by Raith.
Callum Smith neatly won possession on the left side of the area and gave the ball to Turner.
However, the on-loan Ross County midfielder dithered and ended up dumping Shinnie on the deck just inside the box.
Shinnie took the penalty himself but his effort crashed back off the post before striking Dabrowski and squirming to safety.
But the equaliser did come for the Premiership men 10 minutes from the interval.
Substitute MacKay, on for Cristian Montaño, seized on a ball that sailed over the box and curled in a deep cross that Brandon tamed before smashing through a crowded six-yard box.
Second-half stalemate
Aidan Connolly blazed a good chance over just after the break before Raith thought they should have had a penalty.
A free-kick straight from the training ground picked out Vaughan who slalomed his way past the Livi defence before being brought down.
But referee Grant Irvine decided the offence took place right at the edge of the box and Vaughan fired the free-kick high and wide.
Stephen Kelly had one shot saved by Dabrowski and then was off target with another before Rovers came close to a second.
Dylan Easton, introduced for Turner, brilliantly released Liam Dick on a run forward and the defender’s thunderous effort was heading for the roof of the net before George got his glove to it.
Agony for Raith
Rovers had more than matched their top-flight opponents right from the start.
But there was to be bitter disappointment at the end as Livi snatched victory in the 82nd minute.
Raith failed to stop Kelly’s cross from the left and MacKay won the aerial duel to nod in from eight yards out.
Star Man: Lewis Vaughan
Fresh from penning a two-year contract extension, Vaughan was immense.
A menace in attack from the first whistle, this season’s top scorer was everywhere as he tracked back to help out his defence.
He will be disappointed not to get the second-half free-kick on target as Livi eventually won it at the death.
Player Ratings
Raith Rovers (3-1-4-2): Dabrowski 6; Millen 6, Brown 6, Dick 7; Byrne 7 (Gullan 83 3); Connolly 7, Mullin 7, Turner 6 (Easton 67 4), Smith 7; Hamilton 7, Vaughan 8. Subs not used: McNeil, Thomson, Murray, Corr, McGill, Hannah, Masson. Booked: Smith.
Referee: Grant Irvine.
Attendance: 2,580.