Shartash came from last to first to win the Group 2 Railway Stakes in the Curragh at 9/1. Blackbeard the odds-on favourite, led a tightly-packed six-runner field down to the two pole and Ryan Moore asked him for more on the run to the final furlong.
Shartash had to wait for a gap but when it appeared he swept through it inside the final 150 yards to grab Blackbeard close home.
He beat 5/6 favourite Blackbeard by a short head.
Jockey Ben Coen said: "The plan was to get him relaxed early. The last day he won it was kind of a middling gallop, stop-start. Today he had a good even pace to aim at.
"He showed a nice turn of foot when the gap opened. It half opened and I went and it closed again, I had to sit for a stride but to be fair to this lad, he picked up really well when it did open.
"He's hardy and we always liked him. It is nice to get that big win in these colours (Aga Khan) as well.
"I think so (more to come), he loved that ground out there and I think he is only going to get better with racing. For an Invincible Spirit, his mind is unbelievable. He is one to look forward to."
Johnny Murtagh said: “These colours have been very lucky to me throughout my career. We’ve had some great days.
“For His Highness to send us horses was special and to win the Railway Stakes is a great day for the team. He’s a nice horse that is improving all the time and he had to be brave today.
“Ben says he has a good turn of foot and the good ones have a turn of foot. Ben said he wasn’t in a great position but when he got into the gap he quickened up well.
“After he won in Naas we thought this race would really suit him well. We freshened him up and it’s great when it all comes together.
“He’s in the Phoenix Stakes.”
Paddy Power gave Shartash a first show of 33/1 for the 2,000 Guineas.