Bayern held off the challenge of English horse Toast of New York to win the $5m (£3.13m) Breeders' Cup Classic - America's richest race.
Bayern, ridden by Martin Garcia and trained by Bob Baffert, led from the start at Santa Anita, California, and tried to kick on turning from home.
Toast of New York, ridden by Jamie Spencer and trained by Jamie Osborne, just failed to get past the winner.
But Bayern had to wait for a stewards' inquiry before the win was confirmed.
The horse, whose trainer Baffert is a three-time Kentucky Derby winner, had swerved to his left out of the starting gate and collided with the favourite Shared Belief, hampering his chances of maintaining his unbeaten run.
|BBC racing correspondent Cornelius Lysaght|
|"Osborne's career as a talented jockey and now trainer has seen him experience a variety of highs and lows. So it's probably fair to say he doesn't really believe in fairy-tales. This year, however, with a big in Dubai and now two lucrative US placings, globe-trotting 'Toast' has become the stuff of legend for Osborne's small operation. And the good news is that he's all set to race on in 2015 when more air miles are sure to be clocked up."|
Kentucky Derby and Preakness Stakes winner California Chrome was third, having filled that spot for much of the race.
The only European-trained winner on Saturday's second day of the event, known as the thoroughbred world championships, was the French challenger Karakontie, who beat fellow French hope Anodin and the David Simcock-trained Trade Storm in the Breeders' Cup Mile.
The Richard Hannon-trained Toronado, who led early on, faded in the home stretch.
Racing on the dirt track for the first time, Toast of New York was ridden expertly by Spencer, 34, who is due to retire at the end of the year to pursue a management role.
Owner Michael Buckley said: "This has brought me to tears, I so desperately wanted Jamie Spencer to win on this horse before he goes off into retirement.
"We can carry on dreaming because the Dubai World Cup is only five months away but he has got to get there in good shape.
"This is an amazing horse and is the toast of lots of things in my heart."
Osborne added: "This is a huge emotional thing for myself, Michael and Jamie - he has run his heart out and nearly pulled off the impossible.
"I'm incredibly proud of him and all the team. Yes, it hurts to come second."