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.