Berwick saw their Scottish Cup run come to an end when they were beaten by Championship side Dumbarton at Shielfield.
Rangers, who were attempting to get through to the last 16 of the competition for the first time since 2000, got off to a good start with Lee Currie firing them in front with a free kick after only seven minutes,
But Dumbarton hit back with a penalty and a goal before half-time and a third goal after the break saw them safely through to the last 16 for the first time since 1984.
Berwick, with Darren Lavery playing as the lone striker – Scott Dalziel was on the bench – had been boosted by the fact that reserve goalkeeper Billy Bald passed a late fitness test just three weeks after undergoing an operation on his leg.
Goalkeeping coach Gary O’Connor, who played in the fourth round home win over Peterhead, had been on stand-by, but was one of seven substitutes named.
In the first half Berwick took the lead through skipper Currie with a thunderous free kick.
Ross Gray had been fouled by Andy Graham and Currie beat Jamie Ewings from 25 yards out on the right
Bald boosted his confidence with a good take from a corner, but he had no chance when Bryan Prunty buried a penalty past him after half an hour.
Mark Gilhaney played a cross into the box on the right but Stephen Tulloch, at close range, blocked with his hand, and referee Des Roache pointed to the spot.
Dumbarton got their noses in front just before half-time when Mitchell Megginson cut in from the right after 42 minutes. He rode two tackles on the edge of the box before shooting low past Bald from 20 yards out with a composed finish.
At the start of the second half Stevie Notman shot weakly at Ewings after the ball was back-heeled to him in the box.
But the tie was effectively killed off with the visitors added a third goal after 55 minutes, Scott Linton producing a neat left foot shot low past Bald from the left hand side of the area.
As Berwick tried to respond Dean Hoskins had a 30 yard strike tipped over the bar by Ewings for a corner.
Prunty almost added a fourth when he headed against a post and they also had the ball in the net near the end but the effort was ruled out for a hand ball. Right at the end Bald went full stretch to deny Kirkpatrick.
Berwick manager Ian Little said his side had the early momentum after their goal, but the turning point was the penalty, or in his view, the failure of the officials to award a free kick in the build-up.
“After that the momentum swung Dumbarton’s way,” he said. “They showed their class in the second half and the third goal effectively killed us off.”
Berwick Rangers: Bald, Jacobs, Hoskins, Dunlop, Tulloch, Janczyk (Dalziel 60), Currie, Notman, Lavery (Morris 68), Gielty, Gray (O’Brien 71).
Booked: Hoskins 30 dissent; Currie 62 hand ball; Gielty 79 dissent.
Dumbarton: Ewings, McGinn, Linton, Graham, Barry, Gilhaney, Turner, Kirkpatrick, Prunty (Nish (72)), Smith, Megginson (McKeracher 86).
Referee: Des Roache.