Shock, dismay and laughter. That was the response on social media after the initial Kentucky Derby winner, Maximum Security, was disqualified for interference during the race.

After stewards determined that the horse dangerously impeded the paths of others, Country House was declared the winner. It was the first time in the Derby's 145-year history a horse was disqualified for action during the competition. (The initial 1968 winner was later disqualified over a drug test).

An explanation of the historic inquiry ruling that disqualified Maximum Security, making Country House the @KentuckyDerby winner. pic.twitter.com/YZqqn4ucbJ — NBC Sports (@NBCSports) May 4, 2019

Reaction on social media generally fell under three themes: Displeasure with the ruling, comparisons to other famous flip-flops and references to the 2016 presidential election, in which a victorious Donald Trump lost the popular vote but won the presidency.

Among those expressing dismay was Philadelphia Inquirer reporter Tom Fitzgerald, who spoke for many when he tweeted, "Maximum Security wuz robbed!"

NFL's New Orleans Saints, subject of some controversial calls on the gridiron, tweeted an emoji.

🧐 — New Orleans Saints (@Saints) May 4, 2019

The switch in winners from Maximum Security to Country House inspired memes based on other famous instances in which announced victors were soon replaced. Steve Harvey's mistaken announcement of a winner in the 2015 Miss Universe was used as a basis for Derby memes.

The winner of your 2019 Kentucky Derby is ... Maximum Security pic.twitter.com/R0t7lBfA3D — Mike Rennette (@mike_rennette) May 4, 2019

Another meme was based on the 2017 Academy Awards' fiasco in which "La La Land" was mistakenly announced as winner of Best Picture.

I'm sorry, there's been a mistake. Country House, you just won the #KentuckyDerby2019! pic.twitter.com/CXYiCc6ig2 — Ben Abramowitz (@ben_abramowitz) May 4, 2019

Many folks, however, seemed to think the most obvious analogy was to the 2016 presidential election, where Trump emerged victorious in the Electoral College even as he lost the popular vote.

"This is the 2016 election of Kentucky Derby’s," tweeted Bay Area podcaster and sports reporter Ray Woodson.

"Man we are letting the second place finisher win everything these days," tweeted Mike Maccoby, former speechwriter for Obama administration Attorney General Eric Holder.