After defending champion Marcus Ehning of Germany produced a clear round in a five-horse jump-off in 45.68 seconds, Farrington went for broke to clinch the trophy at Madrid's exclusive country club, the Club de Campo Villa de Madrid, with a clear round in 45.18 seconds.
Television pictures showed the 36-year-old from Chicago extended his lead over Ehning after he made his Belgian-bred bay mare Gazelle take a sharp turn into a big combination jump in the middle of the eight-fence jump-off.
"It was extremely close," Farrington said in a televised interview after beating Ehning and his French horse Pret A Tout by half a second. "I took an extreme risk and it paid off."
It was the first European leg of the 15-stop Longines Global Champions Tour, the world's richest, after events in Mexico City, Miami Beach and Shanghai.
A capacity crowd watched nine of the world's top 10 riders battle it out for ranking points and prize money as temperatures rose to as high as 27 degrees Celsius.
Riding into the vast arena as the last rider in the jump-off to the tune of "Mission:Impossible", overall LGCT leader Lorenzo de Luca played it safe aboard Armitages Boy as he calmly jumped a clear round in 50.59 seconds to finish in fourth place as dusk fell.
His Madrid victory means Farrington, a team silver medalist at the Rio Games, rose 26 spots to No. 8 in the overall LGCT standings.
Although De Luca remains the overall leader, Maikel van der Vleuten of the Netherlands narrowed the gap between him and the Italian to nine points after he steered his horse VDL Groep Verdi TN N.O.P. to third place in the jump-off with a clear round in 45.86 seconds.
Global Champions League
Earlier on Saturday, Olympic showjumping legend Ludger Beerbaum teamed up with fellow German Marco Kutscher to give Cannes Stars its first win in the Longines Global Champions League
Beerbaum, a four-time Olympic gold medalist, and Athens 2004 bronze team and individual medalist Kutscher produced four clear rounds to win the two-day team event.
Both men know each other well, with Beerbaum giving Kutscher his first break into showjumping when he hired him in 1999 to help him break in his young horses. Kutscher left the Beerbaum stables in 2014 after a highly successful 14-year partnership to start his own venture.
The win moved Cannes Stars two spots higher on the overall table to fifth place with a total of 74 points after four events. Valkenswaard United remained in the lead with 88 points, seven points clear of Hamburg Diamonds.
The next leg of the LGCT will take place the final weekend of May in Hamburg, Germany.