For the only time in the 145-year history of the Kentucky Derby, the first horse across the finish line was disqualified for a foul on the track.

Country House, a chestnut colt trained by Bill Mott and ridden by Flavien Prat who went off as a 65-1 longshot, sprung one of the biggest upsets in the centuries-spanning history of America’s most famous thoroughbred race when it was declared that unofficial winner Maximum Security impeded the path of two horses in the final turn.

Maximum Security, always on the lead after breaking well as a 4-1 favorite, appeared to have won by one-and-three-quarters lengths in 2:03.93 over a sloppy course, but a jockey objection was filed in the immediate aftermath. The stewards at Churchill Downs spent roughly 20 minutes examining the replay before ruling Maximum Security made a move that significantly changed the outcome of the race when his hind right leg bumped into War of Will, making the unprecedented decision of taking down a Kentucky Derby winner for track action.

The sensational reversal, surely one of the most controversial verdicts in the sport’s history, stunned the crowd of 157,729 at Churchill Downs.

“It feels pretty darn good,” said Mott, the Hall of Fame trainer who became a first-time Derby winner aged 65. “It was an odd way to do it and we hate to back into any of these things. We’ll just have to prove ourselves in the future.”

Code of Honor came in second ahead of Tacitus, who finished third. A pair of Bob Baffert entries, Improbable and Game Winner, came in fourth and fifth, respectively.

Maximum Security, ridden by Luis Saez for Gary and Mary West and trainer Jason Servis, was declared 17th of the 19 finishers.

Country House, who had won only once in six career starts entering Saturday’s one-and-a-quarter-mile race, paid an eye-popping $132.40, $56.60 and $24.60.

The only other time a Derby winner had been disqualified came in 1968, when Dancer’s Image was taken down after a post-race drug screening announced several days after the race.