Updated

KANSAS CITY, Mo. -- The Kansas City Royals maintained their hold on the the second American League wild cardThursday night.The Seattle Mariners are trying to hunt them down for a postseason berth.

After the Royals rallied for a 6-4 victory Thursday over the Mariners, they upped their lead to 2 1/2 games over Seattle in the wild-card standings.

The Royals and Mariners meet again Friday in the second game of a key four-game series.

The Mariners were 21-29 on May 27 after losing seven of eight and looked like anything but a playoff contender.

"Back in May, we were just hoping we could get here," Mariners manager Scott Servais said. "Quite frankly, I didn't know if we could. At one point, we were seven or eight below .500. You know you've got a lot of work to get back.

"But we've gotten healthy. I knew that we would. And we're starting to figure out the pitching thing a little bit. But the key thing has been our bullpen and our offense.

"We want to be more consistent. It's really good for four or five days and then it'll kind of take a step back, so the consistency of that is going to be really important for us."

The Royals also began the season poorly. They lost 20 of their first 30 games, but a 17-9 record in June and a 16-10 record in July have put them into contending position.

"It is the ebb and flow of baseball. That's exactly what it is," Royals manager Ned Yost said.

The Royals managed just three runs and 15 hits in losing three games at Baltimore before returning home to face the Mariners.

"I was sitting on the plane last night trying to think what was the difference offensively between Detroit, Boston and Baltimore," Yost said.

The offense was clicking in starting the trip 5-1 in Detroit and Boston.

"I'm trying to analyze the at-bats. For me, I didn't see anything different," Yost said of the first two stops. "The only thing I saw different was we didn't get the big two-out hits. They shut down the middle of our order.

"In terms of the quality of our at-bats, I didn't see anything different, with the exception of a rare at-bat or two that was any different from the great at-bats in Boston or in Detroit when we faced great pitching."

The Royals will face one of the hottest pitchers -- if not the hottest -- in the American League on Friday when the Mariners start left-hander James Paxton.

The American League named Paxton the pitcher of the month for July, when he went 6-0 with a 1.37 ERA, allowing six runs in 39 1/3 innings while striking out 46 and walking six in six starts.

Since returning from the disabled list May 31, Paxton is 8-3 with a 3.36 ERA, 80 strikeouts and 20 walks in 69 2/3 innings over 12 starts.

The Royals will counter with right-hander Jason Hammel, who has turned around his season after a mediocre start. He is coming off a Sunday triumph at Fenway Park in which he held the Red Sox to three runs and seven hits over seven innings. He walked none and struck out six.

After issuing 10 walks in four starts before the All-Star break, he has walked just two in his past three starts.

Hammel, who did not sign with the Mariners after they drafted him out of Port Orchard, Washington, is 3-2 with a 3.41 ERA in seven career appearances against Seattle. He has not pitched against them since 2014.

The Royals are 4-0 against the Mariners this season and own a 124-98 advantage at Kauffman Stadium.