2017: four-year-old season
On his first appearance as a four-year-old, Ulysses was partnered by Atzeni in the Gordon Richards Stakes at Sandown Park on 28 April and started 3/1 second favourite behind My Dream Boat in a field which also included Royal Artillery (Rose of Lancaster Stakes) and Deauville (Belmont Derby). He was settled in sixth place before taking the lead a furlong out and won by a length from Deauville despite hanging left in the closing stages.
In the Prince of Wales's Stakes Royal Ascot in June Ulysses took the lead a furlong out but was overtaken in the closing stages and finished third behind Highland Reel and the Tattersalls Gold Cup winner Decorated Knight. Jim Crowley took the ride when Ulysses started at odds of 8/1 for the Eclipse Stakes on good to firm ground at Sandown on 8 July. The Derby runner-up Cliffs of Moher started favourite ahead of Barney Roy (St James's Palace Stakes) while the other six runners included Decorated Knight, Eminent (Craven Stakes, fourth in the Derby) and Lightning Spear (Celebration Mile). He was towards the rear or the field for most of the way as the outsider Taj Mahal set the pace, but began to make rapid progress on the outside in the straight. He went to the front a furlong out and fought off a persistent challenge from Barney Roy to prevail by a nose in a photo finish. Stoute, who was winning the race for a record sixth time commented "He's an admirable horse. He's only ever had one blip and that was in the Derby, when he got knocked over twice. He's very consistent, and today the first two came right away from the third".
Three weeks after his win at Sandown Ulysses was stepped up in distance for the King George VI and Queen Elizabeth Stakes over one and a half miles on good to soft ground at Ascot. He proved no match for the three-year-old filly Enable but came home in second place, ahead of Idaho, Highland Reel, My Dream Boat and Jack Hobbs. In the International Stakes at York Racecourse on 23 August Ulysses started at odds of 4/1 in a seven-runner field. He faced several old rivals including Barney Roy, Cliffs of Moher, Decorated Knight and My Dream Boat but the favourite for the race was the 2000 Guineas winner Churchill. Crowley tracked the leaders before moving his mount forward to take the lead a furlong out. Ulysses stayed on strongly in the closing stages to win by two lengths and a neck from Churchill and Barney Roy. After the race Stoute said "We’ve become very fond of this horse. It all went so smoothly – there was never a blip. It was his best performance so far. It's now time to give him a break." He went on to name the Breeders' Cup as the horse's likely end of year target.
In late September it was announced that Ulysses would be retired from racing at the end of the season and would begin his career as a breeding stallion at the Cheveley Park Stud at Newmarket.