* Both sides score three tries apiece
* Scotland lead 17-12 at half time (Adds details, quotes)
By Colin Packham
SYDNEY, June 17 (Reuters) - Scotland beat Australia for the first time in more than four years on Saturday, winning 24-19 in Sydney to avenge two consecutive narrow defeats, including a controversial World Cup exit, by the southern hemisphere team.
Both teams scored three tries apiece but accurate goal kicking and strong defence in the last quarter saw Scotland secure victory in front of 30,721 fans.
It was Scotland's first win against the Wallabies since 2012 and ends a run of three straight defeats by Australia, including the 2015 World Cup quarter-final loss that was decided by a last minute Bernard Foley penalty contentiously awarded by referee Craig Joubert.
"I'm really proud of the effort the players put it in. The last 15 minutes were fresh in our minds, so it required a lot of effort," said Scotland coach Gregor Townsend.
Scotland led for much of the match, enjoying a five-point lead at the half-time interval.
Early Scottish dominance of the ball saw them score the first try of the match as they punished an Australian error.
Although Australia secured a turnover, a terrible pass from scrum-half Will Genia gave his team mate little chance and the ball landed straight into the arms of Scottish centre Duncan Taylor, who raced away to score the first try of the match.
Australia, however, responded quickly as Foley found Israel Folau in space to free the full-back to race clear for his 23th international try.
Australian momentum was quickly eroded though when Foley was sin-binned for obstructing a Scottish breakaway.
Scotland made their numerical advantage count, but in surprising circumstances as Scotland fly-half Finn Russell charged down a Genia box-kick, before grounding the ball under the posts.
Again Australia struck back. Folau got his second try shortly before half-time after climbing above Scottish winger Rory Hughes to claim a cross field kick from Foley to bring Australia within striking distance at the break.
It looked Australia would again win a close encounter, especially when a Genia try saw Australia level after sustained Wallaby procession.
But Scotland struck back, as winger Lee Jones skipped through some tired tackles before the ball was eventually grounded by flanker Hamish Watson.
Australia responded, coming close several times to crossing for a match-winning try but Scottish defence withstood the pressure to ensure a famous victory.
Australia coach Michael Cheika said a try at the death, however, would have hidden failures of his team.
"We were a half-a-yard shy all night, we did not have the urgency that was required," said Cheika. (Editing by Amlan Chakraborty)