Scotland's Simon Danielli celebrates his second try against Romania in the Rugby World Cup. Photograph: Lynne Cameron/PA

Romania were within 10 minutes of pulling off one of the greatest upsets in the history of the World Cup. They recovered from an appalling start to take the lead as Scotland, so assured in the opening minutes, became ragged after being taken apart going forward.

Scotland went into the game with reputedly the biggest pack in the tournament but found themselves shunted backwards as Romania's gnarled front row, featuring two players based in France and London Irish's Paulica Ion, exerted such a grip that the Oaks looked like pulling up a mighty tree.

Simon Danielli stamped on their dreams. The wing had not seen much of the ball after helping to create the game's opening try on eight minutes, cutting back inside after a defence-splitting pass by Joe Ansbro to free Mike Blair.

Scotland were level at 24-24 when, with six minutes remaining, Danielli capitalised on a rampaging run by Richie Vernon before he finished off a flowing move to give his side a bonus point and leave Romania, who had come so close to defying pre-tournament expectations that none of the smaller nations were capable of defeating teams in the top 10, with nothing.

"A game lasts for 80 minutes and I was looking forward to seeing how we would react when Romania went ahead," said the Scotland coach, Andy Robinson, who had been in table-thumping mode long before his players lost their way.

When Chris Paterson's third penalty gave the Scots a 21-11 lead 12 minutes into the second half, Robinson reacted by bringing off Ruaridh Jackson and Richie Gray and replacing them with the steadier Dan Parks and Nathan Hines.

Romania took control up front and neutralised Scotland's threat with the ball in hand, which had been emphasised by their second try, when the impressive Ansbro wrong-footed four defenders. Suddenly the quest for a bonus point became a case of any victory would do.

Romania, who had twice beaten Scotland in their heyday, in 1984 and 1991, were vulnerable after conceding turnovers and they had little threat behind but, spurred by the Perpignan hooker Marius Tincu, they turned what had seemed to be a rout after the first quarter when Scotland led 15-3 – it would have been 17-3 but for Paterson, who had a 100% kicking record in the last World Cup, missing a conversion in front of the posts after the ball fell off its tee just before he struck it – into the tensest of tussles.

The Romania prop Mihaita Lazar scored their first try just before half-time, finishing off a driving maul, and he set the tone by mangling his opposite number Geoff Cross in scrum after scrum. The referee, David Pearson, could have penalised Cross for four offences at one set piece with the tighthead ending up in a heap and it was as well for Scotland that Marin Dumbrava struggled to cope with the swirling wind.

Scotland had prepared for the tournament by training in Brisbane. The temperature at the southern tip of the South Island was quite a few degrees colder, but Robinson's men felt the heat when, on 66 minutes, another dominant Romanian scrum ended with the No 8 Daniel Carpo taking three defenders over the line with him.

"We could have done with the game ending then," said the Romania coach, Romeo Gontineac. "We were eight minutes short, lacking concentration, fitness and technique towards the end. Scotland took advantage and the shame is that we finished without even a bonus point. It was hard to watch and harder to swallow. We were so close to making history."

Scotland's next three opponents are all known for their scrummaging power: Georgia, Argentina and England. "We had the right attitude in the first 15 minutes and could have taken control but the next 60 minutes were very disappointing as Romania showed how destructive they can be in the scrum and maul," said Robinson. "That is something we have to sort out."Tincu, who vexed the organizers of the Heineken Cup three seasons ago when he successfully challenged a six-month ban imposed for gouging that allowed him to carry on playing in the Top 14, did not quite say it was nearly one in the eye for those who felt smaller countries had no place in the tournament. "We had nothing to lose and just enjoyed ourselves. Years from now, when we reflect back on today, we'll be proud of ourselves."