The son of Galileo became the first horse since Triple Crown hero Nijinsky in 1970 to win both the Irish Derby and the St Leger, in his first race since his success at the Curragh 77 days earlier.
The Anvil soon established a big lead from his three O'Brien-trained stablemates, led by Douglas Macarthur with Venice Beach and Capri just behind.
Then there was a gap to John Gosden's duo of Stradivarius and Coronet.
The Anvil was a spent force tuning for home into the long straight, where Douglas Macarthur briefly took over.
Stradivarius looked a real threat on the far rail, but Capri (3-1 favourite) was already close to the pace and set sail for home inside the final quarter-mile.
Crystal Ocean made a strong run from the rear, but Capri held the aces to score by half a length and give O'Brien a fifth win in the race. Stradivarius was just a short-head away in third.
Moore said: "He's a very good horse, he's an Irish Derby winner and a Group Two-winning two-year-old as well. He's run in a lot of good races this year, he's a very good horse and very honest.
"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.
"It was a very good performance in a very good St Leger."