Godolphin star Hartnell outstayed Japanese ace To The World to win the BMW at Rosehill.
In a stirring finish to the 2400m race, Hartnell ($3.10) rallied for jockey James McDonald to give trainer John O'Shea his most important win since taking over as Godolphin's Australian trainer.
After the New Zealand stayer Fast Dragon set a strong tempo, Hartnell and To The World made their runs together from the 600m after they had lost some ground when getting around the heels of Opinion, who had broken down.
They improved their positions to be within striking distance of the leaders on the turn before taking charge of the race soon after.
To The World, the $2.60 favourite, momentarily had the better of Hartnell, but the import came again from the 200m and drew clear to win by 1 lengths.
O'Shea says it will be a weight-for-age race that will be remembered for a long time. "When they cleared out, wasn't it exiting?" O'Shea said.
The Chris Waller-trained Beaten Up ($101) took third place, a half neck further back.
Hartnell's win was McDonald's fourth, soon to become five, for the meeting and came one race after his narrow defeat on First Seal in the Group One Vinery Stud Stakes.
"Something happened midrace with Opinion I think breaking down and I lost several lengths and I thought I was in a bit of strife," McDonald said.
"But I knew I was on the superior stayer and I'm just so happy I came out on top."
Hauraki (by Reset) capped a memorable day for McDonald and Godolphin when he confirmed his spot in next week's ATC Australian Derby with an explosive run in the Tulloch Stakes.
His win came 40 minutes after Hartnell and followed the earlier wins of stablemates Medcaut and Generalife in support races.
All four Godolphin winners were ridden by McDonald, who also won out the Emancipation Stakes aboard Catkins for Chris Waller.
Sheikh Mohammed's head trainer John O'Shea was not surprised by the jockey's achievement.
"He has been a very special young man in our life and he deserves all the accolades and results he gets," O'Shea said. "He conducts himself with humility. He is a hard worker and an amazing young talent."
— AAP