SARATOGA SPRINGS, N.Y. — Trainer Bill Mott said at midweek there were enough reasons for Good Samaritan to try the Jim Dandy Stakes, even though the field included the winners of the Kentucky Derby and Preakness, and even though his horse had never run on dirt.

The big bay stallion responded by delivering a stunning victory Saturday at Saratoga Race Course, storming from way back to the lead coming down the stretch to win the Grade II Jim Dandy, and leaving Derby winner Always Dreaming and Preakness winner Cloud Computing in his wake.

“You saw him coming through the stretch,” Mott said. “It looks like he was good enough to get it done today. He looked pretty good.”

Good Samaritan beat Giuseppe the Great by 4 3/4 lengths as the two long shots in the race finished in front. Always Dreaming was third, Pavel fourth, and Cloud Computing last in the five-horse field in a race worth $600,000.

Always Dreaming set the early pace, getting out to four lengths, before Cloud Computing drew alongside after closing on the far turn. Good Samaritan was last, 12 1/2 lengths behind Always Dreaming after a half-mile run in 48.53 seconds, and Mott was worried he would not be able to close.

“When they turned down the backside I said, ‘I don’t know how they’re going to catch that horse,’ ” Mott said after his fourth win in the Jim Dandy and first since 1998. “I thought he (Always Dreaming) was on such an easy lead. I didn’t think it would be possible for him to catch him at that time. It looked like the whole field was in trouble at that point.”

At the top of the stretch, all five horses fanned out across the track, with Good Samaritan on the far outside with jockey Joel Rosario, and he quickly raced to the front to give the 64-year-old Mott a victory on his birthday for the 16th time. Good Samaritan covered the 1 1/8 miles in 1:50.69 and paid $19.20, $5.60 and $3.50. Giuseppe the Great returned $8.50 and $3.90, and Always Dreaming paid $2.90 to show.

It was the second straight loss for the Todd Pletcher-trained Always Dreaming, who won his first four starts by a combined 23 1/4 lengths before finishing eighth behind late-charging Cloud Computing in the Preakness. Both horses entered the race well-rested but at the end were no match for Good Samaritan on a warm, picture-perfect day.

“He broke really well, and it went like we were expecting,” Always Dreaming jockey John Velazquez said. “We got the lead and he (jockey Javier Castellano aboard Cloud Computing) was laying second because that’s the type of horses they are. He put in a really good fight down the lane, he just couldn’t get away from the other horses, for whatever reason.”

Good Samaritan, who won twice last year, was winless in three starts in 2017, though he did finish second twice in Grade II starts and was fourth three weeks ago in the Belmont Derby. Mott said Good Samaritan is likely pointed now at the Travers, which was the original plan before Mott and Winstar Farm president Elliott Walden changed their minds and opted for the Jim Dandy.

“Our job is to make stallions, and dirt stallions are worth more than turf stallions,” Walden said.

The field marked the first time since 1991 that the winners of the first two legs of the Triple Crown series met at Saratoga. Derby winner Strike the Gold faced the Preakness winner Hansel in the Travers that year and neither horse won. Only eight Derby winners have returned to Saratoga since.

The Jim Dandy is a major prep race for the $1.25 million Travers Stakes on Aug. 26, which is expected to attract Always Dreaming, Cloud Computing, Belmont Stakes winner Tapwrit. If all three horses run in so-called Midsummer Derby, a 1 1/4-mile race for 3-year-olds at Saratoga, it would mark the first time that’s happened since Gato del Sol, Aloma’s Ruler and Conquistador Cielo dueled in the 1982 Travers, won by Runaway Groom in a surprise.

The Jim Dandy is named in honor of the horse that scored one of thoroughbred racing’s more notable upsets. He beat Triple Crown winner Gallant Fox in the 1930 Travers at odds of 100-1, one of just seven victories in a 141-race career. The 54th running of the Jim Dandy had three candidates trying to pull off another upset at a track known for them and Good Samaritan delivered.

Earlier Saturday, El Deal pulled away down the stretch and beat Awesome Banner by eight lengths in the Grade I Alfred G. Vanderbilt Handicap at Saratoga, while favored Limousine Liberal took third.