Raith Rovers 3 Elgin City 2
Raith Rovers are into the Challenge Cup semi-finals for the first time since winning the competition in 2014, but they were made to sweat by 10-man Elgin City.
A first-half double from man of the match Kieron Bowie had the home side in a commanding position only for Kane Hester to pull one back before the break, with defensive lapses allowing the visitors to finish the first half on top.
A superb strike from wing-back Dave McKay restored Rovers' two-goal advantage early in the second half and the League One leaders were cruising when Elgin had Rabin Omar sent off for a late challenge with 25 minutes remaining.
The tie looked done as Rovers kept the ball effortlessly at times, hitting the post and bar as they pushed for a fourth, but the League Two part-timers had other ideas, and a goal out of nothing from the impressive Shane Sutherland set up a nervy finish.
The 10 men threw bodies forward in search of the late equaliser that would have taken the tie straight to penalties, and in the end, the Kirkcaldy side were glad to hear the final whistle.
With only two enforced changes from the weekend win over Stranraer, the strength of the Raith starting line-up paid respect to the fact that Elgin reached the quarter-finals by virtue of impressive away wins at Hibs U20s, Dundee and Airdrie.
Iain Davidson returned from suspension to replace the injured Michael Miller while Dan Armstrong came in for the cup tied Jamie Gullan.
The sponsors were handing out free Tunnock's Caramel Wafers before kick-off, and the Elgin defence were also giving away treats as Rovers opened the scoring in their first meaningful attack on six minutes.
In his first ever match in front of live TV cameras, Bowie showed why he is so highly regarded, starting and finishing the move as he swept the ball out wide to Kieran MacDonald and then raced into the box to convert John Baird's knock-down from close range.
The 17-year-old was looking sharp and he went close to a second when he was played in by Ross Matthews, only to drag his effort wide of the far post.
Bowie was proving too much for the Elgin defence to handle, and on 25 minutes he pounced on a loose ball in the box to bundle his way past two defenders, then coolly rounded goalkeeper Thomas McHale to slot into the empty net.
Any managers watching BBC Alba who weren't already scouting Bowie most certainly will be now and Rovers may well be bracing themselves for January offers for one of their brightest talents in years.
Half an hour had been played and Elgin had barely laid a glove on a Raith side playing some excellent football, but, helped by some shaky defending, the visitors rallied towards half-time.
Steven Anderson was fortunate not to concede a penalty when he leaned an arm towards a ball in the box, then Hester forced Ross Munro into a save with a shot across the face of goal.
The away side made the most of their purple patch on 35 minutes when a ball into the box deflected to Hester who struck a first-time volley past Munro - game on.
Elgin were now showing the traits that took them into the last eight, taking the game to Raith and were unlucky not to go in level at the break when Hester sprung a flimsy offside trap to force Munro into a near post save, then fresh-aired an even better chance with the goal at his mercy.
Rovers used the interval to steady the ship and regained control of the match thanks to a high-tempo start to the second half, leading to their third goal on 56 minutes.
Brad Spencer, who pulled the strings all night, won possession deep in the Elgin half, setting up an attack that ended with MacDonald's cross falling to the inrushing McKay 18 yards out and the defender smashed an unstoppable shot past McHale.
The right-wing back position may not be a natural one for the centre-half, but with finishing like that, he is certainly putting himself forward as a viable option.
Raith could have put the game out of sight - Bowie had a chance for a hat-trick but a rush of blood to the head saw his hurried attempt sliced wide, then Armstrong tried his luck from 20 yards only for a deflection to take his effort onto the post.
Elgin were controversially reduced to 10 men on 65 minutes when Omar flew into a late challenge on Benedictus and referee Euan Anderson deemed it worthy of a straight red card when arguably a yellow would have sufficed.
Rovers brought on the fresh legs of Lewis Allan, back from injury, Tony Dingwall and Grant Anderson as they pushed for a fourth, with Allan coming closest with a shot on the turn that rebounded off the crossbar.
Elgin were tiring and seemed content to settle for damage limitation, but Raith are often at their most vulnerable when they appear comfortable, and so it proved as Sutherland raced through a gaping hole to reduce the deficit to 3-2 with seven minutes left.
It was Sutherland's 20th goal of the season already - and the 29-year-old's performance suggested he should be playing at a higher level.
Rovers had become too relaxed and they were almost made to pay in the final minute when Elgin won a corner, and the ball broke to Brian Cameron in space at the edge of the box.
His powerful effort flew over the crossbar, and the home side breathed a sigh of relief.
While Elgin gave a good account of themselves, it could and should have been more comfortable had Rovers avoided the slackness.
They can now enjoy a weekend off as the other quarter-finalists look to join them in the hat for next week's draw.