Last updated on .From the section Scottish Premiership

Rangers slipped to a second successive defeat as Dundee earned their first win in seven matches to move off the bottom of the Scottish Premiership.

Mark O'Hara lashed in the opener after the visitors' defence failed to deal with a free-kick.

Josh Windass swiftly levelled after pouncing on a poor clearance from Josh Meekings to rifle home.

But O'Hara tucked away the winner with 10 minutes left after superb play from Dundee substitute Scott Allan.

Rangers, who missed a host of first-half chances, Daniel Candeias the biggest culprit, remain fourth, nine points behind leaders Celtic.

Rangers have had a week dogged by defeat to Hamilton and continuing uncertainty and supporter frustration over the search for a new manager, a task that shows no sign of progression and which now has no chance of ending with Derek McInnes moving to Ibrox. McInnes knocked the idea out of the park on Friday.

Dundee have travails of their own. They went into this one on the back of five defeats and a draw, a run that has stripped them of any confidence while putting them on the bottom of the table.

This was an eventful if poor-quality game. In the first half alone there were any amount of chances.

Kenny Miller had a close-range header, Faissal El Bakhtaoui had a long-range shot, Alfredo Morales hit the side-netting, and Daniel Candeias hit Elliot Parish's face when through one-on-one with the Dundee goalkeeper.

Daniel Candeais wasted the best first-half chance for Rangers when clear through the middle

That was a terrific chance for Rangers, followed quickly by another close shave for the home side when Josh Meekings took a swing at a cross and directed it on to his own crossbar. Miller then had another decent opportunity just before half-time, but his effort was too weak to trouble Parish unduly.

Rangers fans would have watched this movie before; dominance, chances, but no breakthrough goal and then a sucker punch at the other end.

For some there might have been a flashback to Ibrox a week ago when good moments were wasted and Hamilton took advantage. Maybe they had a premonition of what was to come.

The little bit of edge that Rangers had in the opening half was blunted in the second. Their chances dried up as Dundee came into it.

The goal that unlocked the game was a simple ball into the box from a Jon Aurtenetxe free-kick and a total lack of authority in the Rangers defence. The ball broke free to an unmarked O'Hara, who thumped it past Wes Foderingham.

Visions of Hamilton - and other games besides - would have filled the thoughts of the visiting support but no sooner had they given voice to their fury, they were level.

Poor defending was again at the heart of it, Windass, previously unmapped while playing through the middle, rifled a loose ball past Parish. The lack of defensive nous would have driven Dundee boss Neil McCann scatty.

Josh Windass fired Rangers level, but they couldn't build on it

But not for long. McCann brought on Allan just as the game looked to be petering out. Allan, with his Celtic background, was booed on to the pitch by the Rangers support. Within minutes he rendered every last one of them speechless.

When picking up the ball just outside the Rangers penalty area, Allan tried to twist and turn into space but could not find any. He went one way, then another, then it opened up for him. He slid a gorgeous pass through to O'Hara, who took a fine first touch and then buried the chance.

Rangers went in pursuit of an equaliser, but they never went close. They lacked urgency and intelligence, they were one-paced and unthreatening.

Dundee saw it through to the end with ease. What a night for them this was. A massive victory for McCann, the kind of confidence boost he's been longing for after weeks of disappointment.

For the visitors, this was more of the same. Defeat to the bottom team in the league, no manager, no leadership, a desperately frail temperament and a season that is turning into a nightmare.