In a historical reversal, Country House was declared the winner of the 145th running of the Kentucky Derby at Churchill Downs on Saturday following “an inquiry ruling” and the disqualification of Maximum Security, officials said.

The disqualification marked “the first time in 145 years” that “the horse who finished first in the Kentucky Derby was disqualified,” the official Twitter account for the sporting event said.

Country House was a 65-1 longshot in the race that included 18 other competitors. Maximum Security, who crossed the finish line first amid sloppy conditions, was disqualified after an objection was filed, claiming that it interfered with the path of multiple horses.

Stewards spent roughly 20 minutes going over video of the race from various perspectives before ultimately declaring Country House the winner.

The horse’s jockey, Flavien Prat, celebrated following the announcement. It was the first Derby win for both Prat and trainer Bill Mott.

Code of Honor was second, with Tacitus third. Maximum Security was listed as coming in 17th place.

Earlier this week, Omaha Beach — the then-favorite to win the Kentucky Derby — was scratched from the competition due to a breathing problem.

Trainer Richard Mandella told The Associated Press that the horse developed a cough and a subsequent veterinary exam showed the colt has an entrapped epiglottis. It’s generally not life- or career-threatening and is typically corrected with minor surgery.

The Associated Press contributed to this report.