Scotland were never going to do it the easy way, were they?

It was an extraordinary, controversial finish to the match and to this topsy-turvy group stage of the ICC T20 World Cup qualifiers but, in the end, Scotland lost out on third place - and a much easier path to qualification - in the most heart-breaking manner. They were once again put through the wringer: delight, tension and despair all in the space of a couple of hours.

It was Denmark who faced them on the pitch, but the real enemy was the spectre of the Nepalese run rate. The ICC had informed the Scots that if they restricted the Danes to 120 runs in their reply they would beat Nepal to an unlikely third-place finish. Having earlier scored 205, Scotland coursed with the belief that it could be done.

But, despite early wickets, some brave hitting by Carsten Pedersen made the task tougher and going into the last over the Scots only had six runs to play with. Two maximums off the first two balls from Hamid Shah ended their chances. The Scots gave up the ghost and conceded more runs as the over fizzled out.

But then, as they trudged off the pitch having conceded 130, an ICC official came wandering over. As it turned out, they had only needed to restrict the Danes to 129. A mistake had been made in the calculations. Over seven matches, Scotland had missed out by a single, cruel run.

The players seethed, stomping around, but captain Kyle Coetzer chose to focus on the positives of another convincing victory. "The mistake has been made," he said. "Tactics may have been slightly different but we've got to deal with it now and win our next two games."

Qualification remains possible, but Scotland now need to win two play-off games in a row. Their first is against Italy on Wednesday and the second against the loser of a Hong Kong-Nepal showdown the next day. It is a tough route.

For once, the Scots had a hearty group of supporters in to watch the match - 100 or so schoolchildren, brought along for the morning, had decided to form an impromptu Tartan Army. Paul Collingwood, a member of the Scotland coaching staff, smiled as he strolled over to sign autographs; he was there for about half an hour, scribbling on hats and pieces of paper rustled up from nowhere.

Matt Machan - the tournament's highest run-scorer with 301 runs at an average of 60 - was again the glue that held the Scots' innings together. Calum MacLeod, not far behind him in the rankings, had started well, making a quick 41 before he was stumped by Frederik Klokker off Michael Pedersen. Michael Leask fired for the first time, too, thumping two massive sixes into the reinforced glass of the ICC academy.

He was eventually caught by Klokker after spooning a Basit Javed delivery in the air. Rob Taylor came out to attack. He was still there at the close, too, making 17 off just nine balls to nudge the Scots over the 200 mark.

Denmark's chase started in the best possible manner, too, a wicket-maiden delivered by Neil Carter. The next went nearly as well, Machan darting in an over for a single. But they started to leak runs, before it was left to the spin of Machan, at the end, to try to contain the Danes. The field was set to the wrong calculations and the Scots sunk once Shah belted the first two balls.

Despite their late anguish, after Tuesday's demoralising loss to Kenya, Scotland would have been delighted to finish fourth. "We've done outstandingly well," said Coetzer. "I can only say thanks and well done to all our players. We're on a bit of a roll now and sides will be looking at us and fearing us."