The 3-1 favourite Capri, ridden by Ryan Moore, won the St Leger at Doncaster for trainer Aidan O'Brien.
Moore gained his first victory in the world's oldest Classic as the Irish Derby winner beat runner-up Crystal Ocean and third-placed Stradivarius.
The grey Capri prevailed after a battle down the straight to give O'Brien his fifth triumph in the race.
"He's a horse with a lot of class and Ryan gave him a great ride," said the Irish trainer.
|Ryan Moore: Now has victories in all five British Classics after previous wins in the 2,000 Guineas, 1,000 Guineas, the Derby and the Oaks.|
|Aidan O'Brien: This was an eighth win in 10 British and Irish Classics this season for O'Brien|
It was his 18th Group One win of 2017 as he closes on the all-time record in a calender year of 25 achieved by the late American trainer Bobby Frankel.
O'Brien saddled four in the 11-runner race, considered one of the best renewals in recent years, and his outsider The Anvil set the early pace.
Stradivarius, under James Doyle for four-time winning trainer John Gosden, took the lead with four furlongs to go,
Crystal Ocean also mounted a challenge but Capri had enough left to see off his rivals in the mile and six-furlong contest.
"When Crystal Ocean came to him, he dug in. He's done very little wrong in his career and has progressed from race to race," said Moore.
"It was a very good performance in a very good St Leger."
Asked for his reaction on winning the race for the first time, Moore replied: "It means you have to win it again, really."
Cornelius Lysaght, BBC racing correspondent
What a tremendous race as Capri was chased through the closing stages by Crystal Ocean and Stradivarius, both their jockeys in dark silks with yellow caps; it was a stirring sight.
Ryan Moore was celebrating his first St Leger at the eighth attempt, but might well have won before, but for Irish Champions Weekend which often clashes.
Not every St Leger over the years has been fantastic in terms of quality, but this was very much on the high side - Moore agreed that those just behind would probably have been good enough to win a 'normal' staging.
Elsworth fuming after being told to leave parade ring
Veteran trainer David Elsworth, the man responsible for the great Desert Orchid among others, was escorted out of the parade ring at Doncaster on Saturday for not wearing the correct accreditation.
Two security guards were sent to take Elsworth, 77, away as his horse, Sir Dancealot, was just returning to be unsaddled after finishing unplaced in the Park Stakes.
Elsworth, who won the feature Doncaster Cup on Friday with Desert Skyline, was incredulous at not being able to speak to his jockey.
On being told he would have to leave the paddock, Elsworth said: "Are you being serious?"
The security guard replied that she was only doing her job on orders from management, to which Elsworth said: "You can tell your manager I am never going to run another horse at Doncaster."
Tim Banfield, executive director of Doncaster, said: "It's a really unfortunate situation, and I'm going to apologise to David.
"We've tried to tighten up on who should and shouldn't be in the paddock and unfortunately David didn't have his trainers' badge with him today.
"If any of us had been down there who recognised David, it wouldn't have happened."