KANSAS CITY, Mo. — Alex Gordon homered and drove in a pair of runs, but it was a catch he made that was equally important in the Kansas City Royals’ 4-3 victory over the Boston Red Sox on Sunday.

Gordon, who has won Gold Gloves the past two years, went face-first into the wall to catch Jacoby Ellsbury’s foul fly ball for the first out in the fifth inning. The Red Sox had opened the inning with a single and a walk off against James Shields.

“We needed an out against Ellsbury, who has been a very hot hitter,” Gordon said. “It was a big out. We got that one and Shields was able to get out of it.

“We’re just going out there trying to make plays for our pitching that’s been carrying us all year. Anything we can do defensively to help them out and get them out of a jam like that, we’re happy to do it.”

Royals manager Ned Yost called Gordon’s catch “a great play.”

“I don’t know how he made that play,” Yost said. “That ball was about a quarter of an inch from the wall when he caught it and slammed into it. A great day for Alex.”

Gordon hit his club-leading 13th homer, a solo blast to right, in the third inning to put the Royals up 4-1.

Is he locked in at the plate?

“I’ll let you know tomorrow,” Gordon said and smiled.

The Royals took three of four from the Red Sox, who own the best record in the American League, and have won 16 of 19.

“After coming off a loss (Saturday), it’s very important just to forget about it and move on, that’s what we did, especially against a good team,” Gordon said.

Shields earned just his second home victory, going seven innings and allowing three runs on seven hits and three walks.

“The defense was spectacular again,” Royals manager Ned Yost said. “Our pitching and defense keeps us in ball games and gives us a chance to win every single day.”

Greg Holland worked a spotless ninth, striking out two, to log his 32nd save in 34 chances.

The Red Sox took advantage of catcher Salvador Perez’s throwing error on a pickoff attempt to score in the first inning. Shane Victorino doubled, stole third and came home on Perez’s error.

The Royals tied it in the bottom of the inning when Gordon’s single to right with two out scored David Lough, who led off the inning with a walk.

The Royals grouped three hits in the second inning with Jarrod Dyson and Lough credited with run-producing singles.

The Red Sox trimmed the lead to one run in the sixth when Ryan Lavarnway’s single down the left-field line scored Daniel Nava and Stephen Drew, who extended his hitting streak to 12 games.

“We had our opportunities; we brought it back to 4-3,” Nava said. “Lavarnway knocked in a couple of runs. Unfortunately it wasn’t enough.”

Red Sox right-hander John Lackey, who is winless since July 12, allowed four runs on five hits and two walks in the first three innings, but gave up just two singles after that before departing after 111 pitches and seven innings.

“We had some opportunities early and hit some balls that didn’t find holes and theirs found some holes,” Red Sox manager John Farrell said. “Early, John couldn’t find his rhythm or his release point and they were able to get some hits and steal some bases. He settled in and gave us seven strong innings.”

Royals second baseman Elliot Johnson went 0-for-3, striking out twice, and is hitless in his past 27 at-bats since a July 6 single against the Athletics.

NOTES: The Red Sox have five of the next seven Mondays off after playing 19 consecutive days. “With the off days, you have a lot to think about,” Farrell said. “Do you bump guys? Maybe you’re going to a four-man (rotation). There’s a lot to consider.”

On Saturday night, Will Middlebrooks made a triumphant return to the Boston lineup.

Middlebrooks and Jacoby Ellsbury each drove in two runs as the Red Sox topped the Royals 5-3.

Middlebrooks, just recalled from Triple-A Pawtucket, lined a two-run single to right field in the four-run fourth inning and also scored two runs.

Middlebrooks opened the season as Boston’s starting third baseman but was sent to the minors on June 25 with a .192 batting average and 60 strikeouts in 203 at-bats.

“I tried to put that as far out of my head as I can,” Middlebrooks said. “It felt good to win a game. I’m just trying to contribute.”

Ellsbury, who went 4-for-5 to match his career high for hits and raise his average to .305, doubled home Middlebrooks in the fourth and sixth innings.

“He squared up some balls tonight and gave me a chance to get around the bases,” Middlebrooks said.

Farrell was pleased to see a productive Middlebrooks.

“It lands on the grass and we score two in the fourth, and then he beats out the ground ball and scores a big run,” Farrell said. “He’s hustling and working hard.”

With two out in the sixth, Middlebrooks hit a slow roller to third baseman Mike Moustakas and beat the throw that led to an insurance run.

“I knew he was playing me deep and I didn’t hit it hard,” Middlebrooks said. “I just tried to get on base.”

Brandon Workman, the second of five Red Sox pitchers, picked up the victory with 1 1/3 scoreless innings. Koji Uehara worked a flawless ninth to log his 12th save in 15 opportunities.