Aidan O'Brien's horse trailed in the final furlong but the favourite hit back to win after a titanic struggle.
Australian speedster Scenic Blast, ridden by Steven Arnold, triumphed in the King's Stand Stakes ahead of Fleeting Spirit and Anglezarke.
Paco Boy in the Queen Anne Stakes was Richard Hughes's first of three wins.
In the Coventry Stakes, Hughes and owner Richard Hannon had their day's second winner with favourite Canford Cliffs, who demolished the field to finish six lengths ahead of Xtension and Rakaan.
Then in the Ascot Stakes, Hughes made it a magical hat-trick of wins after Judgethemoment made a terrific late burst to fight off Sesanta, ridden by Seamus Hefferman, Royal Rationale and Gala Evening.
After Mastercraftsman's dramatic victory in Tuesday's third big race, which follows his Irish Guineas victory, Murtagh was delighted with his horse's performance.
"He gave 110%. He's brave and courageous and like all the best horses, they never know when they're beaten," he told BBC Sport.
"I think he's a true champion - he deserves a lot of credit."
It was O'Brien's sixth victory in the St James's Palace Stakes at Royal Ascot and once again Delegator had to settle for second spot behind 5-6 favourite Mastercraftsman following the defeat in the Irish 2000 Guineas.
|Your name: *|
|Your email: *|
|Recepient's email: *|
|Enter code: *|