Scotland beat Romania by 34-24 in their Rugby World Cup pool match in Invercargill on Saturday.
But it took a long range try with less than five minutes left to avoid Scottish blushes.
Wing Simon Danielli finished off a move that went about 70 metres to break the deadlock when the scores were locked up at 24-all in the 76th minute.
Danielli crossed again two minutes later to put the result beyond doubt and secure the all-important bonus point, but Romanian fans had plenty to cheer about as the minnows pushed the Scots all the way, scoring two tries.
Scotland led by 18-11 at half-time in the tournament's second game at Rugby Park stadium.
Romania was beaten by Scotland at the 2007 World Cup by 42-0.
Result
Scotland: Tries: Mike Blair, Joe Ansbro, Simon Danielli (2)
Penalties: Chris Paterson (4)
Conversion: Paterson
Romania: Tries: Daniel Carpo, Mihaita Lazar
Penalties: Danut Dumbrava (2), Ionut Dimofte (2)
Conversion: Dimofte
Referee: Dave Pearson (England)