In a stunning and historic Kentucky Derby upset, the horse that crossed the finish line first was not the one that was declared the winner.

Maximum Security, the favorite entering the race, outpaced the competition on the muddy track at Churchill Downs and appeared to have won the 145th Kentucky Derby with a time of 2:03.93.

Then an objection was lodged. For several tense minutes, some 150,000 people in rain-soaked ponchos and fancy hats waited for a verdict.

About 20 minutes after the race ended, the race’s stewards announced that Maximum Security — the only undefeated horse in the field — had been disqualified for impeding the path of at least one other horse in the race. The decision handed the victory to Country House, which started the race at 65-1, and a first-time win to hall of fame trainer Bill Mott.

It’s the first time a horse has been disqualified for interference in the history of the race. The result ended a six-year streak of favorites winning the race.

Code of Honor finished second (13-1) and Tacitus (5-1), also trained by Mott, took third.

“It’s amazing,” Country House’s jockey Flavien Prat told NBC Sports after the result was announced. “I really kind of lost my momentum around the turn, so I thought that I was going to win, but it cost me, actually.”

Maximum Security was the race favorite heading into the Run for the Roses, with odds at 4-1 by the evening.

A light drizzle, which followed hours of overcast but dry skies, turned into heavier rain just in time for the race and drenched the main track. Shortly before the race began, the track was downgraded from fast to sloppy.

Last year, several inches of rain also made for a sloppy track. Justify, the favorite, took home that victory.

Copyright 2019 NPR. To see more, visit https://www.npr.org.