RANGERS thought they had suffered heartache and humiliation in the Challenge Cup last year when they lost the final in extra time to Raith Rovers.

But that agonising defeat was nothing compared to the pain they experienced in the Petrofac Training-sponsored competition last night.

The Ibrox giants were leading minnows Alloa 2-0 with just 17 minutes remaining at the Indodrill Stadium and appeared to have one foot in the final.

But they somehow managed to concede three goals to their part-time rivals to crash out of the competition.

The result heaped pressure on Rangers manager Ally McCoist, who was subjected to abuse from his own fans for the second time in three games.

After a draw to Alloa at home and a defeat to leaders Hearts away in the SPFL Championship, the scrutiny that McCoist was under was already intense.

This astonishing collapse and result increased that further and it is debatable if he will be able to survive the calls for his head on this occasion.

It was, without doubt, the worst result of the legendary striker's turbulent three-and-a-half-year reign as manager.

The fact that more than half the Alloa team, who are now unbeaten in three meetings with Rangers this season, were missing, just made matters worse for the under-fire coach.

To exacerbate things further, Lewis Macleod was stretchered off injured in the first half and could be ruled out of action.

McCoist made one change to the side that thrashed top-flight rivals Kilmarnock 3-0 in the Scottish Cup on Sunday.

Kris Boyd, who had come off the bench to score the second goal in the fourth-round match, started and Jon Daly dropped to the bench.

In the continued absence of Lee Wallace due to injury, Richard Foster started at left-back with Darren McGregor filling in for him at right-back.

Rangers suffered a major setback in the 10th minute when Macleod went to ground clutching a hamstring after making a run upfield. The 20-year-old, who has arguably been his side's most consistent player this term, was carried off with his head in his hands.

It was the second time in three months that the talented youngster had pulled up injured on the plastic pitch.

Dean Shiels came on to replace his team-mate and make what was just his second first-team appearance in nearly six weeks.

The Northern Ireland international, who slotted in on the left side of midfield, had come on for the final few minutes of the win at the weekend.

Barry Smith's part-time side had performed superbly in a league outing at Ibrox last month to earn a deserved point and damage their opponents' title hopes.

But the Wasps were without most of their outfield players due to a bug that had ravaged the squad earlier this week. Kevin Cawley, Iain Flannigan, Graeme Holmes, Jason Marr, Stephen Simmons, Jon Tiffoney and David Weatherston all missed out.

They still had the better of the opening exchanges and created more scoring chances than their Glasgow rivals.

Alloa could have taken the lead in 15 minutes when Ryan McCord picked out Ben Gordon in the Rangers area with a free-kick.

Gordon headed the ball down to Greig Spence just a few yards out, only for the forward to shoot straight at keeper Steve Simonsen.

Adam Ashgar missed with a long-range shot in 20 minutes and Liam Buchanan hooked wide in 37 minutes.

The artificial surface at the Indodrill Stadium, which the League One champions had struggled with on their last visit, was clearly not to their liking once again.

However, they started the second half positively and Shiels went close with a header after getting on the end of a McGregor cross.

Rangers edged in front in 49 minutes with a strike that originated from a Kris Boyd free-kick on the edge of the Alloa penalty box.

Keeper Craig McDowall could only parry the shot and Miller pounced on the rebound to fire home his fifth goal of the season.

McGregor forced a good one-handed save from McDowall shortly after as the visitors suddenly assumed control.

McCoist's men forged further in front in 64 minutes with goalscorer Miller turning provider. He supplied Shiels who surged into the box before side-footing the ball beyond the outstretched McDowall and into the bottom right corner.

With victory looking highly likely, McCoist took off Boyd and put on Daly in his place in 67 minutes.

Incredibly, though, the home team got back on level terms shortly after that with two quickfire goals. Spence headed home a Mark Docherty cross in 73 minutes and McCord turned a cutback from Ed Ferns into the net in 75 minutes.

The Rangers players - not to mention their coaching staff and fans - were stunned.

But Daly forced a superb save from keeper McDowall from point-blank range after getting his head on the end of an Ian Black free-kick in 84 minutes.

The big Irishman was to rue that near thing as Spence popped up with just a minute of regulation time remaining to fire in a stunning winner.