SEATTLE (AP) — Less than two months after sitting 10 games below .500, the Kansas City Royals are rolling into the All-Star break and on the cusp of the lead in the AL Central.

Salvador Perez hit a two-run homer in the 10th, Alex Gordon added a two-out RBI single later in the inning and the Royals completed a three-game sweep with a 9-6 win over the Seattle Mariners on Wednesday night.

Perez drove the second pitch from reliever James Pazos (2-2) out to right field for his 17th homer of the season, an inning that started with an error by Seattle’s Robinson Cano. It was the third home run of the game for Kansas City, adding to earlier two-run shots by Mike Moustakas and Lorenzo Cain.

Kansas City won for the sixth time in seven games and handed Seattle its seventh straight loss at home. The Royals are a half-game behind Cleveland for the lead in the AL Central.

“I didn’t really think about. I just knew we would find a way to do it, get back into it,” Kansas City manager Ned Yost said.

Perez said he was looking for a pitch on the outside half of the plate after striking out in both the sixth and eighth innings on pitches away.

“I was looking for something out over the plate. He threw me that pitch and I didn’t miss,” Perez said.

Mike Minor (5-1) pitched the ninth to get the victory and Kelvin Herrera threw the 10th for his 19th save to cap a stellar performance from the Kansas City bullpen. The Royals’ relievers allowed one hit and struck out four in five scoreless innings of relief.

“We felt good, the bullpen just holding the fort until we could score,” Yost said.

Minor had a scare when Mike Zunino led off the ninth with a flyball to deep left field that Gordon caught one step in front of the wall. Zunino’s near-miss encapsulated Seattle’s night, rallying from an early 4-0 deficit only to be held scoreless for the final seven innings.

“I didn’t think it was going to get that far. But then when you see it get so close, you get a little disappointed,” Zunino said.

Nelson Cruz, Jean Segura and Zunino all homered off American League wins leader Jason Vargas for Seattle, but the Mariners were held scoreless after Cruz’s homer leading off the third. Seattle is 2-8 in its last 10 games overall.

“It’s a critical point in our season right now. It really is,” Seattle manager Scott Servais said. “We haven’t played well over the last 10 days or so. We’ve struggled and we’ve got to get it turned around, moving in the right direction heading into the All-Star break.”

Headed to the All-Star Game for the first time, Vargas had his worst performance of the season against one of his former teams. He matched a season high by allowing six earned runs, and the three home runs equaled the number Vargas had allowed in his previous six starts combined.

Vargas was headed toward his first loss since May 22 until Cain’s two-out, two-run homer in the fifth inning tied it at 6-all. Cain hit a 3-2 fastball from starter Ariel Miranda off the out-of-town scoreboard for his 11th homer of the season.

Miranda didn’t look like he would make it out of the first inning after allowing a two-run double to Eric Hosmer and the two-run shot to Moustakas. Miranda quickly settled down, retiring 10 of 11 before a leadoff walk to Gordon opening the fifth. Three batters later, Miranda missed with his 3-2 pitch to Cain and lost out on his chance at an eighth win before the All-Star break.

MOOSE CALL

Moustakas continued his hot stretch. He’s homered in three straight games and in six of the past eight. His 25 homers are tied for the most by an AL third baseman prior to the All-Star break.

HELLO AGAIN

Cruz hit the 299th home run of his career despite a sore knee that turned his home run trot into glorified speed walking. It was his first long ball since June 4, snapping a string of 87 at-bats without going deep. Cruz also had an RBI groundout in the first inning.

ROTATION ADJUSTMENT

The Royals will skip Travis Wood’s turn in the rotation and have Danny Duffy start on Sunday against the Los Angeles Dodgers in the final game before the All-Star break. Duffy will be opposed by Clayton Kershaw.

SLUMPING SEAGER

Seattle 3B Kyle Seager got a rare day off on Wednesday. Seager had started every game since April 27, but in the past 17 games was batting .200 and was hitless in his last 14 at-bats.

UP NEXT

Royals: After an off day, the Royals will open a three-game series against the Dodgers on Friday. Jason Hammel (4-7) will start the opener.