BOSTON (TNS) — The fastball cut across the middle of the plate, and Alex Gordon's hand unleashed a compact stroke, taking out his frustrations on a baseball on a Sunday afternoon at Fenway Park.

All season, Gordon has searched for answers, hoping to find the key to becoming the hitter he once was. The struggles have tested his patience and weighed on the mind. On Sunday, in the hour before the game began, the Royals traded for outfielder Melky Cabrera, a player who could strip playing time from Gordon during the season's second half.

Yet here was Gordon on Sunday afternoon, stepping to the plate in the top of the eighth with runners at second and third and the game tied. Here was Gordon, roping a two-run triple to right-center field off Boston reliever Robby Scott, capping a four-run deluge in the decisive inning.

Gordon's triple broke a 3-3 deadlock and secured a series victory here at Fenway Park, 5-3. The Royals (55-48) have won 10 of their last 11 entering a three-game series in Baltimore on Monday.

On Sunday, they received seven solid innings from starter Jason Hammel, who allowed three runs and seven hits while striking out six. The offense outlasted Boston starter Drew Pomeranz and went to work in the top of the eighth.

The inning began with a gift when Xander Bogaerts committed an error on a grounder from Lorenzo Cain. Eric Hosmer followed by ripping a chopper that staggered reliever Matt Barnes and bounced toward first baseman Mitch Moreland for a single. Moments later, Salvador Perez fought off a two-strike count and poked a single to right field, loading the bases.

Shortstop Alcides Escobar tied the game with a single to right field, which prompted Red Sox manager John Farrell to insert Scott, a left-hander, to face Gordon. Scott missed with a sinker before grooving one in the strike zone.

As the day began, the Royals executed another trade before Monday's deadline, acquiring Cabrera from the White Sox in exchange for minor-league pitchers A.J. Puckett and Andre Davis.

By the end, closer Kelvin Herrera worked around a self-inflicted bases-loaded jam in the ninth, retiring Mookie Betts for his 23rd save.