BOSTON – The Boston Red Sox had emotion and a seven-game winning streak on their side. The Kansas City Royals had the pitching and enough timely hitting to come away with a doubleheader sweep.

Lorenzo Cain walked with the bases loaded in the 10th inning to give Kansas City a 5-4 victory in the second game as the Royals swept a Red Sox team coming off an emotional week.

“Doubleheaders haven’t fared too well for us. We haven’t won many series here,” said Billy Butler, who tied the second game with an eighth-inning homer. “We were real close to winning all three of them. (Daniel) Nava had the big hit yesterday, and we had the big hits today.”

Ervin Santana (2-1) pitched seven strong innings in the opener, which Kansas City won 4-2. Kelvin Herrera (2-2) got the win in the night game, a makeup of the one postponed Friday because of the city-wide lockdown during the hunt for the Boston Marathon bombers.

Alex Gordon had three hits in the second game, including a single with one out in the 10th. Alcides Escobar walked and, after Butler struck out, Eric Hosmer reached on an infield single — his fourth hit of the day.

Andrew Miller (0-1) walked Cain on four pitches to bring home Gordon.

“I thought we had great at-bats in crucial situations,” Royals Manager Ned Yost said. “It was a great at-bat right there. He laid off four pitches to plate the winning run. A lot of times guys get overanxious there.”

Boston led 4-3 before Butler tied it with his third homer of the year, clearing the Green Monster. The Red Sox put runners on first and second in the ninth, and Mike Napoli hit a long fly ball to center field that Cain caught short of the warning track.

“He’s come up with some big hits for us in some RBI situations,” Red Sox Manager John Farrell said. “Unfortunately, that last at-bat where he squares up the ball to the track in center field is somewhat of a picture of this entire day, where we miss a couple of opportunities when we had men in scoring position. And that was the difference in the two games today.”

After Boston’s emotional come-from-behind win Saturday, a more subdued atmosphere — and smaller crowds — greeted the teams Sunday, but there were still some signs that things had changed: The American flag in left-center field remained at half-staff, Red Sox players wore a “B STRONG” patch on their jerseys, and law enforcement officers were cheered whenever they were shown on the scoreboard.

In his first two at-bats of the day game, Jonny Gomes used a bat with the words “Boston Strong” and the names of the four people killed in the bombings and their aftermath. He popped out and grounded out, then said he planned to auction off the bats for charity.

For his third straight start, Santana allowed runs in the opening inning, then settled down, allowing two runs on six hits with no walks and seven strikeouts. Santana has given up four runs and nine hits in his first innings, and one run on 12 hits in his other 20.

“Once he gets settled in, he gets on a nice roll,” Yost said.

The Red Sox loaded the bases with two outs in the eighth against Bruce Chen and Aaron Crow, but Jarrod Saltalamacchia grounded out to Crow. Greg Holland pitched a perfect ninth for his fourth save in five opportunities, then got another save in the night game.

The Royals scored three runs in the fourth inning of the day game. Salvador Perez’s two-run single broke a 2-2 tie against Ryan Dempster (0-2), who had struck out the previous two batters.

Dempster allowed four runs on six hits in seven innings, striking out eight and walking three. That ended a season-opening streak of 16 games by Red Sox starters of allowing three runs or less, tying an AL record achieved by the Oakland Athletics in 1978 and 1981.

Allen Webster made his major-league debut for the Red Sox in Game 2 and pitched six innings, allowing three runs (two earned) on five hits and a walk while striking out five. He took a 3-1 lead into the fifth before giving up home runs to George Kottaras and Alex Gordon.

NOTES: Right fielder Shane Victorino missed both games after leaving Saturday’s win because of back spasms. … Dustin Pedroia has reached base in all 18 games, the most consecutive games to start a season by a Red Sox second baseman, breaking the record set by Pete Runnels in 1959.