Watch all British, Irish and French replays for FREE on the Racing TV website
Rayif came with a late surge on the far side under Mickael Barzalona to deny the British raiders in the Group One mile contest at Deauville.
Trained by Francis-Henri Graffard and sporting the famous green silks of the race sponsors, the three-year-old colt - who won the French 2000 Guineas in May - was held up off the pace in the early stages as the Fozzy Stack-trained Thesecretadversary led the group of horses who stayed in the centre of the track.
As the Japanese runners Sixpence and Strauss stayed towards the near side, the action unfolded in the middle of the course with Precise ridden along over two furlongs out to close on leaders Thesecretadversary and Zeus Olympios who was launching his own bid under Clifford Lee.
As those three scrapped away, Barzalona's mount continued to eat into their advantage on the far side, and came through with a well-timed challenge to collar Zeus Olympios – who had fended off Precise - in the final 50 yards.
The winner - who had finished behind Thesecretadversary in the Prix Jean Prat last time - returned at 6-1, and was surprisingly a first win in the race for both jockey and trainer, as well as a poignant one for connections given the passing of the Aga Khan last year.
Precise, the Irish 1000 Guineas and Coronation Stakes winner, had to settle for third behind Summer Mile winner Zeus Olympios, while the William Haggas-trained second-favourite More Thunder was well held in fifth.
After the race, Graffard said: "I'm very happy. It's a wonderful race to win, a very hard race to win.
"I kept my confidence in the horse, he ran well the other day but with excuses.
"Over that course you need the perfect trip and he had that day; he travelled really well, and he picked up really nicely, and when he got challenged he maintained his advantage and fought well at the end. He was very game
"If they are to find their place at stud they have to perform at this level. The dam of this horse is incredible. It's a dream job at the moment.
“It depends if we decide to go for the Prix du Moulin (September 6) or give him more time and the Prix de la Foret (October 4) could be an option – I wouldn’t be afraid to drop him back in distance.
“There is the QEII at the back-end and we know he can handle soft ground.”
Of the gallant runner-up, his trainer Karl Burke said: “We always thought and hoped he would produce that sort of performance in a Group One. I think physically he’s improving and he showed that today.
“He quickened twice there – first time I thought we’d got it, then he got challenged and then he quickened again and I thought we’d got it and so did Cliff (Lee, jockey).
“The winner, fair play to him, has come and cut us down. Francis can do no wrong, can he?
“We’ll get him home and see how he is. It’s got to be discussed, but as a trainer I’m very hopeful he’ll stay in training next year and I think he’ll just continue improving physically and strengthening, so hopefully if he doesn’t win his Group One this year he’ll certainly get it next year.
“I’d say the race at Longchamp (Moulin) will probably come a bit quick for him, maybe we’ll wait for the QEII at Ascot.”