KANSAS CITY, Mo. -- Salvador Perez had never hit a grand slam in the majors, but he had a premonition and an answered prayer in the eighth inning.
"I was thinking about it two pitches before," Perez said. "I don't know where it's coming through my mind, that I never hit one. I said, thank God. Unbelievable, huh."
Perez homered in the eighth inning after Red Sox relievers Matt Barnes and Robby Scott (0-1) walked the bases loaded with nobody out. Perez worked the count full before propelling a Scott pitch out to left, scoring Jorge Bonifacio, Lorenzo Cain and Eric Hosmer.
"The last pitch was lower in, a little in the middle," Perez said. "And I hit it pretty good. I don't make adjustments. I see the ball and hit it. If it's close, I'm swinging."
Red Sox manager John Farrell decided to keep the left-handed Scott in to face the right-handed swinging Perez.
"His power numbers have come against right-handed pitching, by a 2- or 3-to-1 margin," Farrell said. "He's a .230 hitter against left-handers. It didn't happen today."
Scott walked the left-handed-hitting Hosmer on four pitches, none close to the strike zone, to set up Perez's blast.
"With the go-ahead run at the plate with the possibility of left-on-left to try to get a ground ball, there's four wide ones again," Farrell said. "It set the stage for the grand slam, unfortunately."
Said Scott, "I've got to do better."
Drew Pomeranz held the Royals to two runs over 6 1/3 innings, but the bullpen could not hold a 4-2 lead after he was pulled.
"We've been playing great," Pomeranz said. "You can't win them all. That's going to happen sometimes, especially against these guys. They're swingers. It's part of the game. The bullpen has been great all year. It's just one of those things. We'll forget about it and be back at it on Friday."
Ian Kennedy silenced the Red Sox without a hit in the first three innings, but there were two loud booms to start the fourth. Rookie Andrew Benintendi led off the inning with a 454-foot splash down into the center field fountains. It was his 100th career hit and his 10th home run this season.
Xander Bogaerts took a 3-1 Kennedy offering over the left-field fence to tie the score at 2.
"Those are frustrating pitches," Kennedy said.
The Royals scored a pair of runs on three outs. Eric Hosmer doubled to lead off the second and stopped at third on Perez's single. Hosmer scored when Mike Moustakas grounded into a double play.
The Red Sox took advantage of two Kansas City errors in the fifth to score a pair of unearned runs on one single. Christian Vazquez started it with a single to left. Deven Marrero put down a sacrifice bunt, but Kennedy's throw sailed over the head of first baseman Cheslor Cuthbert.
Vasquez wound up scoring on Betts' sacrifice fly. Kennedy was removed after an intentional walk to Bogaerts. Mike Minor replaced Kennedy and attempted to pick Bogaerts off first, but Cuthbert whiffed on the throw, which hit first base coach Ruben Amaro Jr., allowing Marrero to score.
NOTES: Boston 2B Dustin Pedroia missed the entire series with soreness in his rib cage area after being struck by a pitch Sunday in Houston. The Red Sox are optimistic Pedroia will start Friday. ... Royals LHP Danny Duffy, who is on the disabled list with a strained oblique, will throw a bullpen session Friday and could begin a minor league rehab assignment next week. ... DH Hanley Ramirez, who is hitting .205 with five extra-base hits in his previous 22 games, was not in the Red Sox lineup. He flied out as a pinch hitter to end the game. ... The Royals and Red Sox are off Thursday. The Red Sox return home and will retire David Ortiz's No. 34 jersey before the game Friday against the Angels. The Royals will welcome the Blue Jays to Kauffman Stadium for a weekend series. Royals rookie RHP Jake Junis will start the opener.