Rangers progressed to the last eight of the CIS Insurance Cup after a strong second-half showing at Dunfermline.
Kris Boyd scored a terrific goal at East End Park
Kris Boyd hit the bar for the visitors with a first-half header and the Pars' Jim Hamilton flashed a header wide.
A drab game picked up after the break and Souleymane Bamba could only deflect Alan Hutton's volley into his own net.
Boyd then shrugged off Bamba and crashed in a wonderful dipping shot from 30 yards, while Hutton and Charlie Adam went close to extending the lead.
Rangers made eight changes to the side that lost at Hibs on Sunday, with Gavin Rae and Nacho Novo given a rare chance to impress.
Sasa Papac made his first start since his arrival from Austria Vienna and was partnered in central defence by Brahim Hemdani.
Dunfermline were without cup-tied striker Stevie Crawford, so Freddie Daquin partnered Jim Hamilton up front.
Chances in the opening 45 minutes were few and far between and neither side could find any passing fluency.
Boyd was back in the Rangers starting line-up and he came close to opening the scoring on 18 minutes.
Adam released Chris Burke down the left flank and he delivered a perfect cross but the striker's downward header skipped up off the turf and spun against the crossbar.
The Pars had a great chance when Hamilton met a Stephen Simmons corner with a thunderous header but the effort fizzed wide of the post.
Rangers were more positive after the break and went ahead after 64 minutes thanks to Bamba's unfortunate intervention.
The Pars defender attempted to clear a tame effort from Hutton but only succeeded in scooping the ball beyond his own goalkeeper.
Nine minutes later, Boyd, who had gone close with another header, produced a goal worthy of winning any tie.
The Scotland striker spun off Bamba and latched on to a long hopeful pass, allowing it to bounce once then crashing a shot over Dorus De Vries from all of 30 yards.
Hutton's curling effort looked bound for the top corner of the net before De Vries got his fingertips to the ball.
And Adam saw his shot from 15 yards headed clear from the goal-line as Rangers began to enjoy more space to work in against tiring opponents.
Dunfermline Athletic: De Vries, Shields, Scott Wilson, Bamba, McGuire, Labonte, Mason, Simmons (Muirhead 62), Daquin (Owen Morrison 62), Young, Hamilton. Subs Not Used: McKenzie, Tod, Ross.
Booked: Scott Wilson.
Rangers: McGregor, Hutton, Papac, Hemdani, Smith, Burke (Sebo 77), Sionko (Martin 58), Rae, Adam, Kris Boyd, Novo (Buffel 71). Subs Not Used: Svensson, Robinson.
Booked: Papac. Goals: Bamba 65 og, Kris Boyd 73.
Ref: M McCurry