By Sarah Berkowitz

For the last 50 yards, Cloud Computing and Classic Empire shadowed each other, running nose to nose almost until they hit the wire. In the end, Cloud Computing won the only duel that mattered — the 142nd Preakness Stakes.

It was the first Triple Crown victory for Cloud Computing’s trainer, Chad Brown, and the second for jockey Javier Castellano, who also won in 2006 aboard Bernardini. Their partnership has helped them dominate grass in New York and beyond.

Brown has won nearly every major turf race in America, including seven Breeders’ Cup races on grass and the Arlington Million, and has trained three Eclipse-Award-winning turf horses.

Castellano was aboard Cloud Computing for the first time on Saturday, a switch dictated by Brown, who wanted his go-to rider to get the colt into the race from the start and keep him there.

It worked. Cloud Computing broke sharply and loomed behind Always Dreaming and Classic Empire for most of the race.

“We figured the race would be won or lost in that first turn,” Brown said, “and he won it right there.”

Cloud Computing covered the mile and three-sixteenths at Pimlico Race Course in 1 minute 55.98 seconds and paid $28.80 for a $2 bet. He earned a $900,000 first-place check that was welcomed by his co-owners William Lawrence and Seth Klarman. The victory carried special weight for Klarman, who turns 60 on Sunday and fell in love with horses while growing up three blocks from this battered old racetrack.

There will be no Triple Crown this year, rendering next month’s Belmont Stakes a nice race but one that has now lost its potentially historic dimensions.

For 37 years, from Affirmed’s 1978 Triple Crown sweep to American Pharoah’s in 2015, no horse could grab the sport’s greatest prize, although 13 went to the Belmont with a chance.