KANSAS CITY, Mo. -- Mike Moustakas hit two balls that had chances to go deep.
The first one was just foul down the right-field line, but the second was fair as Moustakas homered to lead off the 13th inning, lifting the Kansas City Royals to a 7-6 victory over the Seattle Mariners on Thursday.
Moustakas homered to right on an 0-2 pitch from Chance Ruffin (0-1), who had not pitched in the majors since 2011.
"I knew it was going to get out, but I knew it was going to be foul soon as I hit it," Moustakas said of the first shot. "I got a little too out in front of it.
"The second one I knew was going to stay fair. I hit it pretty good. I kept my hands in pretty good. It was pretty special with the race we're in right now."
The Royals entered the game 5 1/2 back in the wild-card standings.
"Soon as Moose hit the first one, I was hoping it would stay fair," Royals manager Ned Yost said. "When it didn't, I turned to Hos (Eric Hosmer) and said, 'Why is fate tempting us, teasing us like this. Why?
"Normally when somebody hits a long foul ball homer and they've got two strikes on them that's it. I can't remember one time I've ever seen a guy back it up and hit one fair. So when he hit it fair, it was wow, pretty special."
Ruffin retired the first five batters he faced, striking out three.
"I was trying to get the fastball down and in," Ruffin said. "He turned on it pretty good. The one he hit out was supposed to be in. I left it in the middle."
Louis Coleman (3-0), the eighth Royals pitcher, retired the only batter he faced in the top of the 13th.
Kansas City led 6-5 in the ninth inning before Raul Ibanez homered off Greg Holland into the Mariners' bullpen with two outs to tie the score. It was Holland's first blown save since May 6 to end his streak of 31 consecutive saves.
"He throws 100 (mph) and he has a really good slider," Ibanez said. "I was trying to swing easy, thinking base hit, a single. He threw a slider and I got it in the air to right field. Sometimes if a guy is not throwing too hard you might look to do some damage, but when a guy is throwing that hard you can't try to do too much."
The Royals play their next 12 games against the Detroit Tigers and Cleveland Indians, the two teams in front of them in the AL Central.
"Every game is crucial and extremely important," Yost said. "We've seen our players do this the majority of the year. They don't believe if we're down by five we're out of it or we're going to lose the game."
Billy Butler went 5 for 5, matching his career high in hits for the Royals, while Emilo Bonifacio went 4 for 6 for his first four-hit game since July 4, 2009.
"It's not easy to come back from a five-run deficit," Butler said. "That shows the resiliency of this team. Every game at this point is a must win."
The teams combined to use 44 players, including 14 pitchers.
The Mariners threatened in the 11th when Dustin Ackley singled and Nick Franklin walked. Kelvin Herrera, the sixth Royals pitcher, replaced Tim Collins and struck out Franklin Gutierrez and Mike Zunino to end the inning.
Butler drove in the tying run with his fourth single in a three-run seventh. Justin Maxwell's sacrifice fly scored Butler to put the Royals up 6-5.
Royals catcher Salvador Perez went 3 for 3 with a double and RBI, but left in the fifth with dizziness. He took a foul shot from Dustin Ackley off his mask in the top of the fifth.
Mariners left-hander Joe Saunders was staked to a 5-0 lead, but could not make it through the fifth inning.
Saunders gave up a two-run homer to Alex Gordon and an RBI single to Salvador Perez in the fifth. When Justin Maxwell walked to load the bases, Saunders was replaced by Brandon Maurer, who struck out pinch-hitter Carlos Pena on three pitches to end the inning.
Saunders allowed three runs and 11 hits and a walk in 4 2-3 innings. In his past six starts, he is 1-3, allowing 50 hits, including six home runs, in 31 2-3 innings.
Maurer, however, gave up four consecutive hits to start Kansas City's three-run seventh.
Justin Smoak hit a two-run homer in the Mariners' three-run first. It was Smoak's third home run in 13 at-bats off Royals right-hander Jeremy Guthrie. Kendrys Morales singled home Abraham Almonte, who had doubled, with the first Seattle run.
Hosmer's fielding error in the third allowed Kyle Seager to score another run. The Mariners made it 5-0 in the fourth on Brad Miller's sacrifice fly.
Guthrie was pulled after six innings, allowing five runs and seven hits and two walks. He is 1-3 with a 5.11 ERA in his past six starts, yielding 53 hits and 21 earned runs in 37 innings.
NOTES: Seattle RHP Felix Hernandez, the 2010 AL Cy Young Award winner, will miss his scheduled start Sunday and has been pushed back to Wednesday. Hernandez left his Monday start against the Royals in the seventh inning with lower back cramps. "He wants to start on Sunday and we understand that," manager Eric Wedge said. "He felt a lot better yesterday and feels better again today. He's going to go out and play some catch, but we're going to be cautious with him." ... Royals 2B Chris Getz, who suffered a possible concussion on Tuesday, said he was feeling better Thursday, but left the stadium to see a doctor. He suffered a concussion Sept. 12, 2010, and missed the remainder of the season. ... Royals INF Jamey Carroll started at third base after not playing in the previous seven games.