Line Of Reason got up in the final strides to claim the William Hill Scottish Sprint Cup Handicap at Musselburgh.
Paul Midgley's charge was sent off an 11-1 shot for the contest after finishing ninth behind the reopposing Caspian Prince among others in the Dash at Epsom last time out.
He looked unlikely to take a hand in the finish with a furlong and a half to run as Harry Hurricane had assumed control and seemed certain to gallop on to victory over the minimum trip.
However, Joe Fanning got Line Of Reason rolling down the middle of the track and he gradually pegged back Harry Hurricane before just edging in front by a neck on the line.
Kimberella was three-quarters of a length back in third with Caspian Prince the same distance back in fourth.
Midgley said: "That was great. He's always been a good horse but we just lost him for a bit in Dubai (over the winter) and after he came back, it's just taken a while to get him back.
"Fast ground and speed is what he's all about really. He was due a bit of luck too as he's not had too much in the past.
"Joe gave him a good ride, he kept it simple as the horse likes something to aim at.
"He's entered at Beverley on Tuesday and I might be tempted to go there, we'll see how he comes out of this, but the Rockingham in Ireland (July 2 at the Curragh) would be the race for him."
Midgley was completing a double as Orient Class (16-1) had earlier landed the William Hill Tartan Trophy Consolation Race Handicap, a £40,000 event for those eliminated from the main prize.
Partnered by 7lb claimer Connor Murtagh, Orient Class was in front with a furlong to run and he was driven out to hold off Zac Brown by a length and a quarter.
Midgley said: "I thought he might find this ground a bit quick, but he travelled well and looked like the winner from a fair way out.
"Connor gave him a good ride. He claims 7lb, but it's a big 7lb.
"He won well and I'm sure the handicapper will have his say now. It's nice to win a big prize with him though and it's been a good day."