Blair Kinghorn was saint turned sinner for Scotland as he scored and assisted two sensational tries, only to miss a final minute penalty which handed victory to Australia.
The stand off was under the microscope after being handed the number 10 jersey, with Finn Russell controversially left out for the autumn test series.
The Scots also rued a second half yellow card that allowed the Wallabies to claw themselves back into the game from nine points down.
Kinghorn produced some moments of magic as he brought his multi-faceted skillset to play as a packed Murrayfield.
But he was left on his knees at the final whistle after his boot let him down on the match defining penalty.
The Wallabies threatened first with a snipe from scrum half Tate McDermott who galloped into space and chipped from 22 metres out but couldn’t collect on the end of it after running into the defender.
Scotland recovered from some errors to take the lead from a brilliantly worked set play off the lineout.
The Scots won a scrum penalty and from the resulting line-out they broke off with Hamish Watson feeding Sione Tuipulotu.
The Australian-born centre fed Blair kinghorn who popped the ball to Ollie Smith and the Glasgow Warriors full back ducked and dived past the remaining defenders to score on his international debut.
A penalty for a ruck infringement by Schoeman allowed Australia to hit straight back with three points from the boot of Bernard Foley.
After a spell of poor Scottish discipline, conceding penalties that the Wallabies couldn’t turn in to meaningful pressure, in was the dark blues who started to turn the screw.
Tuipulotu butchered a golden opportunity when he spilled an arcing miss-pass from Kinghorn with the line gaping.
That was on an advantage but as the Scots tried to ram it in from close range for try number two, Glen Young, on as a sub for Sam Skinner, was held up over the line and the Aussies could clear their lines with a drop out.
Scotland slipped back into gifting the visitors territory through conceded penalties but their defence stood up in the shadow of the posts – Schoeman, Smith and Ali Price among those making timely interventions.
But one mistake too many at the breakdown gifted another kickable effort to Foley, who split the uprights to bring round half time with the score 6-5 to Australia.
The second half could scarcely have started better for Scotland – and for the man in the limelight, Kinghorn.
Handed the number 10 jersey in Russell’s absence, the Edinburgh fly half seized on a spilled ball and booted it towards the Australia 22.
The pacey converted full back won the foot race and showed a little football skills to take it clear and gather before plunging over for the try. He converted the kick to take the score to 12-6.
The Wallabies were getting under the referee’s skin with backchat and repeat infringements and one such offside was kicked over by Kinghorn for another three points.
Scotland were reduced to 14 men for 10 minutes when Glen Young connected with the head of McDermott in a clear out – the second row only escaped a red as the connection came from his bicep rather than shoulder.
The tourists made the numerical advantage count when they wore down the defence with quick phase play and captain James Slipper dived across to score.
Foley’s extras reduced Scotland’s lead to two points with a quarter of the match to play.
A miscommunication between Van der Merwe and Smith allowed a catchable kick to touch to roll out and give the Wallabies excellent field position. After the resultant maul was stopped Hamish Watson was pinged for offside and Foley helped the men in green and gold to a 16-15 lead.
Taniela Tupou was called for an infringement as Scotland tried to go through fast phases and it handed Kinghorn a chance to kick the winning points. But with Murrayfield hushed and all eyes on him, he pulled it wide and the Wallabies snaffled the ball into touch to claim the narrowest of victories.
Player Ratings
Ollie Smith 7 – Took his try brilliantly and grew in confidence under the high ball.
Darcy Graham 6 – Unusally quiet night for the man in sizzling club form.
Mark Bennett 6 – Very little chance to open up his slippery running game but defended stoutly.
Sione Tuipulotu 7 – Constantly tested the defence with his carrying.
Duhan van der Merwe 7 – Was a nuisance in the air and provided his usual muscle in the carry.
Blair Kinghorn 7 – All eyes were on the man presumed now to be the first choice 10 and he produced a thrilling solo try, plus an assist for Smith. Could have won the match at the death but his boot deserted him.
Ali Price 7 – Marshalled the attack well enough without much sustained territory. Kicking was hot and cold.
Pierre Schoeman 6 – The sublime and the ridiculous from the bulldozing prop, who was a menace at the breakdown but gave away some penalties too.
Dave Cherry 6 – A little inconsistent with his throwing. Scrum held up and efficient in defence.
Zander Fagerson 6 – Plenty of bite in the trenches and anchored the scrum well.
Sam Skinner 4 – Lost possession, won a turnover, went off injured in the first half.
Grant Gilchrist 6 – Gave away some soft lineout penalties. Tackled and carried with purpose.
Jamie Ritchie 7 – Constantly on the edge, showing that captaincy will dull none of his combative instincts.
Hamish Watson 6 – Quieter than usual outing for the all action openside.
Matt Fagerson 6 – Has lovely footwork in his carries but will feel he could have contributed more.
Replacements 5 – Glen Young showed some great athletic actions but was fortunate not to be sent off for a dangerous clear out. Front row kept the scrum up and gave late game muscle. Backs were unable to influence a comeback.
Follow STV News on WhatsApp
Scan the QR code on your mobile device for all the latest news from around the country