Scotland wing Simon Danielli saved his team from an embarrassing opening World Cup defeat by scoring two tries to help see off Romania 34-24 at Rugby Park on Saturday.
Against all odds, Romania had the Scots hanging on the ropes after leading by three points with ten minutes of the match remaining.
However, a fourth penalty from veteran full-back Chris Paterson and two well-taken tries by Danielli denied the Oaks what would have been a sensational win.
Instead, an unconvincing Scotland outfit take maximum points courtesy of scoring four tries but will know there is much work to be done ahead of their next match against Georgia on Wednesday.
The last time the teams met at the World Cup, Scotland beat Romania 42-0. And after scrum-half Mike Blair and centre Joe Ansbro scored early tries for Scotland , it looked like another rout was in the works.
But Romania outplayed Scotland for much of the second half after trailing by just seven points (18-11) at the break, thanks to prop Mihaita Lazar's try on the stroke of half-time.
Paterson had got Scotland off the mark with an early penalty before Blair scored the opening try on seven minutes. Great hands from Joe Ansbro released Danielli whose mazy run was well supported by Blair for the scrum-half to add the finishing touch.
Romania pivot Marin Dumbrava made up for a missed shot at goal by opening Romania's account with a well-struck penalty just a minute later.
Scotland blew two try-scoring chances, but soon found the whitewash again after Ansbro shot through three would-be tacklers for a superb try under the sticks. Paterson converted for a 15-3 lead, and Scotland looked to be in control... or so we thought.
Dumbrava replied for Romania with another penalty and the Oaks were unlucky not to get their first try as they hammered away at Scotland's tryline through their powerful pack.
Somewhat surprisingly Romania opted for a shot at goal when a 5m scrum collapsed, but Dumbrava failed to take advantage and captain Marius Tincu was left to rue his decision.
Paterson showed Dumbrava how it was done with his second penalty shot of the half to give Scotland an 18-6 lead, but Tincu got it right the second time when this time he turned down three points and opted instead for the line-out and drive with one minute of the half remaining.
Romania's heavies drove Scotland over their line, with prop Lazar being awarded the try. Dumbrava missed the conversion but went into the half-time sheds with their tails up after having the final say in the first half.
Paterson missed an early penalty chance after the restart, while a mixture of good defence and poor ball retention left Scotland frustrated.
Paterson, playing in his fourth World Cup, found the target on 52 minutes to give Scotland a ten-point cushion - but once again Andy Robinson's side gave away another needless penalty from the restart, with centre Tiberius Dimofte - taking over kicking duties from subbed Dumbrava - slotting over the three-pointer.
Suddenly Romania found some self-belief - and with replacement halfback pair Florin Surugiu and Ionel Cazan pulling the strings, they hammered away at the Scotland line before Dimofte slotted over another penalty.
The impossible looked very probable for the underdogs when number eight Daniel Carpo picked up the ball from the base of a 5m scrum and powered over for the try. Dimofte's conversion put his team three points ahead and amazingly, Romania were in a suprise lead.
Scotland bounced back to level the scores through Paterson and Scotland fans were breathing a sigh of relief as Danielli raced over with five minutes left after a storming break and offload from number eight Richie Vernon along the touchline.
Danielli added his second two minutes later to seal the deal for Scotland.
Man of the match: Marius Tincu. Romania were just 10 minutes away from creating history, and in that time their captain was subbed. Why coach Romeo Gontineac pulled the side's most inspirational player off the field baffles us. But he did enough beforehand to get our vote.
Moment of the match: Daniel Carpo's try followed by Tiberius Dimofte's conversion to take the lead. This is what World Cups are made for!
Villain of the match: No yellow or red cards to report.
Tries: Blair, Ansbro, Danielli 2
Pens: Paterson 4
Tries: Lazar, Carpo
Con: Dimofte 2
Pens: Dumbrava 2, Dimofte 2
Scotland: 15 Chris Paterson, 14 Max Evans, 13 Joe Ansbro, 12 Sean Lamont, 11 Simon Danielli, 10 Ruaridh Jackson, 9 Mike Blair, 8 Richie Vernon, 7 John Barclay, 6 Kelly Brown, 5 Alastair Kellock (c), 4 Richie Gray, 3 Geoff Cross, 2 Ross Ford, 1 Allan Jacobsen.
Replacements: 16 Scott Lawson, 17 Alasdair Dickinson, 18 Nathan Hines, 19 Ross Rennie, 20 Chris Cusiter, 21 Dan Parks, 22 Rory Lamont.
Romania: 15 Iulian Dumitras, 14 Stefan Eugen Ciuntu, 13 Csaba Minya Gal, 12 Tiberius Ionut Dimofte, 11 Madalin Vlad Lemnaru, 10 Marin Danut Dumbrava, 9 Lucian Mihai Sirbu, 8 Daniel Carpo, 7 Ovidiu Tonita, 6 Mihai Macovei, 5 Cristian Constantin Petre, 4 Valentin Neculai Ursache, 3 Paulica Ion, 2 Marius Tincu (c), 1 Mihaita Alexandru Lazar.
Replacements: 16 Bogdan Zebega Suman, 17 Silviu Florea, 18 Valentin Poparlan, 19 Sandu Stelian Burcea, 20 Florin Surugiu, 21 Ionel Cazan, 22 Florin Adrian Vlaicu.
Referee: Dave Pearson (England)