Sri Putra pipped Saamidd in a thrilling finish to the Get Your Bet On At Blue Square Paradise Stakes at Kempton.
Roger Varian's old stamp (11-2) was held up off the pace and moved through to challenge for the lead with a furlong to run.
As Andrew Balding's Side Glance (11-4 joint-favourite) tried to rally on the far side, a strong challenge came from Frankie Dettori and Saamidd down the stands rail.
However the mount of Neil Callan kept a straight course down the centre of the track and managed to cling on to win in a photograph.
Varian said: "He's a good horse. He doesn't win very often so it's nice to see him win today.
"He would have come here for a racecourse gallop if this meeting hadn't been on as the ground would have been too soft for him at Ascot.
"He's probably now going to go to Italy a week on Sunday for the Premio (Presidente) della Repubblica at Capannelle."
Saeed Bin Suroor's Saamidd (11-4 joint-favourite), off the track for a long time through injury, ran a fine race in second and was probably disadvantaged by coming wide off the final bend, whilst Side Glance was clear of the rest back in third.
Godolphin racing manager Simon Crisford said of the runner-up: "We are very happy with that run.
"He'd fractured his pelvis so he'd been off for a long time.
"Frankie (Dettori) said that the horse just took him wide, but we are very pleased and it's good to see him back."
Scarf and Skilful cut out the early running but faded late on after setting a strong pace.