Hoppertunity had been in a funk, if you can call earning more than $2 million in less than two years a slump. The 5-year-old had won only two of his previous 14 races while chasing some superstars, so Bob Baffert wanted to find an easier spot to boost his confidence.

Most trainers would have dropped him into an allowance race, but not the all-conquering Baffert. So he shipped Hoppertunity from California to Belmont Park for Saturday’s Jockey Club Gold Cup. Rarely can a million-dollar race be considered a class drop, but nothing is beyond Baffert, and the field for the 98th Gold Cup was far from its toughest.

The trip was more than worthwhile, paying $600,000, as Hoppertunity grinded past Effinex in the final furlong for a half-length victory that ended a three-race losing streak.

“We didn’t want to run at home, and this race is a mile and a quarter,” assistant trainer Jimmy Barnes said. “This horse wants distance, and that was the main reason to come here.’’

Three of Hoppertunity’s losses this year came against California Chrome, the world’s top-rated dirt horse and the heavy favorite for the Nov. 5 Breeders’ Cup Classic. Hoppertunity hasn’t finished worse than fourth in his last 11 races, so it’s not as if he’s been off form.

“He’s had a tough campaign,” Barnes said. “He’s won at Santa Anita, he’s won at Churchill the past two years. This race was always in the back of our mind.’’

Hall of Fame Jockey John Velazquez worked out a smooth trip over Big Sandy, a track he’s owned for 25 years. He kept Hoppertunity within striking range of pacesetter Protonico, sitting fourth and then third of five before running down a game Effinex in the stretch.

advertisement | advertise on newsday

“I wanted to be inside and save all the ground I could,” Velazquez said. “He did everything I asked him to do, and when I pulled him out, he responded.”

The bay son of Any Given Saturday was timed in 2:00.68 on a track rated fast but dampened by a steady drizzle. He paid $9.60 and raised his earnings above $3.56 million with his sixth win in 22 starts. Completing the order of finish were Protonico, Mubtaahij and Watershed.

Effinex earned $200,000, raising his bankroll for Tri-bone Stables past $3.24 million. His breeder, Dr. Russell S. Cohen, was justifiably proud of his New York-bred. “We haven’t missed anything with him, he hasn’t shied away from anybody,” the veterinarian said. Not even Triple Crown winner American Pharoah, to whom Effinex finished second in last year’s Classic. A return trip is planned for Effinex.

“We’re in for the Breeders’ Cup,” Cohen said. “There’s no question about it, we’re going.’’