American Pharoah's trainer, Bob Baffert, gets emotional after winning the Breeders' Cup Classic in the last race of the horse's career. (2:39)

LEXINGTON, Ky. -- Hail and farewell, American Pharoah.

The Triple Crown champion won the $5 million Breeders' Cup Classic by 6½ lengths Saturday, taking charge out of the gate in his final race before retirement.

The 3-year-old colt ran 1¼ miles in a track-record 2:00.07 as the sentimental 3-5 favorite among the crowd of 50,155 at Keeneland. Fans stood 20-deep all along the rail, cheering and snapping cellphone photos of the superstar horse and jockey Victor Espinoza.

Except American Pharoah didn't hear them. He wears ear plugs to muffle any sounds that might startle him.

"This was for Pharoah," trainer Bob Baffert said. "We wanted him to go out the champion he is."

American Pharoah took on seven rivals after Smooth Roller and champion mare Beholder dropped out. Beholder had the speed and the class to potentially make the race a contest, but a lung ailment sidelined her on Thursday.

It probably didn't matter how many faced American Pharoah on a cloudy, cool day in the cradle of American horse country.

He smashed the old track record of 2:05.36 by more than five seconds.

"The winner is one of the most amazing things I've seen," said Irishman Aidan O'Brien, who trained last-place Gleneagles.

It was a feel-good moment for a sport that has been battered and bruised -- all the troubles of declining attendance and drug controversies were wiped away in two magical minutes.

"It's a horse racing fairy tale and I just happen to be in it," Baffert said.

American Pharoah was moving easily under Espinoza, keeping Effinex a length back in second for the first half-mile. Effinex was never a threat, though, and American Pharoah extended his lead to 3½ lengths turning for home.

"I was trying to open it up as much as I can," Espinoza said. "I saw the wire maybe 20 yards [away], and for me it was not coming fast enough because I want to cross that wire and get it over with."

After easing across the finish line, Espinoza took the colt far up the first turn before slowly walking past the grandstand to the winner's circle, accompanied by raucous cheers all the way. The champion even had his own military escort walk him back to his barn.

The fans knew they had just witnessed history, the final chapter in a story that may never be repeated.

Victor Espinoza rode Triple Crown winner American Pharoah to a $5 million victory in the 2015 Breeders' Cup Classic. Pharoah topped the old track record of 2:05.36 by more than five seconds. Richard Mackson/USA TODAY Sports

American Pharoah put an exclamation point on a brilliant career in which he lost just twice -- in his debut last year at Del Mar and again in the Travers on Aug. 29.

In the Classic, he paid $3.40, $3 and $2.40. The win, place and show pool wagered on the race was $8,269,736.

Effinex, a 33-1 shot, returned $14.20 and $6.60. Honor Code was another 4½ lengths back in third and paid $3.40 to show.

Keen Ice, who vanquished him at Saratoga, finished fourth in the Classic. Tonalist, the 2014 Belmont winner, was fifth, followed by Hard Aces, Frosted and Ireland-bred Gleneagles.

Frosted unexpectedly pressed American Pharoah on the lead in the Travers, leaving him vulnerable to the rally by Keen Ice.

This time, no one could keep up with the champ.

"It's a lot of pressure to train a horse like this because I didn't want to let the horse down and I didn't want to let the fans down," Baffert said. "I'm just so proud of him; it's like watching my child out there."

American Pharoah won nine of his 11 career starts, including the first sweep of the Kentucky Derby, Preakness and Belmont in 37 years this spring. He earned a total of $8,650,300 for Ahmed Zayat, the Egyptian-born owner who chose to keep his popular horse in training so fans could see him run.

"We wanted him to go out as a winner," Zayat said. "He is a winner."

American Pharoah had already ensured his place in history by ending the Triple Crown drought. He won the Derby by a length and then easily handled a sloppy track in the Preakness to win by seven lengths. In the Belmont, he led all the way en route to a dominating 5½-length victory.

After winning the Haskell Invitational in early August in Zayat's home state of New Jersey, American Pharoah took his show to upstate New York to run in the Travers. His loss by three-quarters of a length raised the question of whether he had peaked, and an emotional Zayat considered retiring him.

Triple Crown's Lasting Legacy American Pharoah followed in the steps of these four Triple Crown predecessors by winning the final event of his racing career in Saturday's Breeders' Cup Classic. Horse Year Final Race American Pharoah 2015 1st Affirmed 1978 1st Seattle Slew 1977 1st Secretariat 1973 1st Citation 1948 1st --ESPN Stats & Information

But the colt went back to his Southern California base with Baffert and regrouped. He quickly showed he was regaining his old form in training, in between entertaining visitors from children to Julia Roberts alike at his Santa Anita barn.

In a sport rife with jealousy, Baffert earned kudos from his rival trainers for how he handled the horse. Fellow Hall of Famer D. Wayne Lukas popped into the post-race news conference to congratulate Baffert.

"I knew he'd break their heart at the half-mile pole, and he did it," Lukas said. "You had him ready. On behalf of every trainer who gets up and tries to make a living, I want to congratulate you."

American Pharoah was a remarkable blend of exceptional talent and a winning personality. Unlike most high-strung, unpredictable thoroughbreds, he was friendly and patient with fans who wanted to pet and pose with him.

"The kindest, friendliest, happiest, easiest, most brilliant horse I've ever seen in my life," Zayat said. "He connected with people. He loves people. I knew he got it."

Next up for American Pharoah is a new career as a breeding stallion at a farm in Kentucky bluegrass country near Keeneland.

"It's going to be sad to see him go," Baffert said. "But I think he's done enough. He's proved enough."

Turning to his 10-year-old son Bode, the trainer said: "We're going to miss him, aren't we, buddy?"