KANSAS CITY, Mo. (AP) It was hard to tell who'd been slumping more lately: Lorenzo Cain or the Kansas City Royals.
With one swing of the bat, Cain may have gotten both of them on track.
The All-Star outfielder capped a three-run ninth inning with a two-out single to left Tuesday night, bringing home Mike Moustakas and giving the Royals a 7-6 victory over the Washington Nationals.
''I've definitely been struggling - bad. But hopefully that helps turn things around,'' Cain said. ''We've played in a lot of games like that, a lot of comebacks we managed to win.''
Tanner Roark lasted into the eighth inning for Washington, but he was relieved by Felipe Rivero with runners on the corners and one out. Eric Hosmer grounded into a fielder's choice to make it 6-4, but Rivero got through the rest of the inning to turn the lead over to Jonathan Papelbon.
The veteran closer served up back-to-back singles to start the ninth. Papelbon (1-1) struck out Omar Infante, but Moustakas came on to pinch hit and guided a single through the left side to knot it 6-all.
Alcides Escobar kept the line moving with a single to center, and Cain fell behind 0-2 before ripping a liner into the gap in left-center to keep the Royals from losing for the seventh time in eight games.
''These guys are tough to put away. They don't strike out much,'' Papelbon said. ''They pride themselves on not striking out. They use their speed and they took that game from us.''
Chien-Ming Wang (1-0) earned the win with a scoreless ninth inning.
''Those are the kinds of wins that help you get going. It's been a rough week for us,'' Royals manager Ned Yost said. ''These guys have the character that they'll keep fighting.''
Anthony Rendon and Daniel Murphy hit early homers, and Jayson Werth hit one late for Washington. The Nationals coaxed across three runs in the sixth inning, giving them what looked like an insurmountable lead against the sluggish Kansas City offense.
Luke Hochevar allowed those three runs in his only inning of work, the reliever following another subpar outing by Chris Young. He lasted 4 2/3 innings to put a massive burden on his bullpen.
After falling behind on Rendon's homer in the first, the Royals answered with three runs in the third inning. Escobar tied the game with his RBI single, and hot-hitting Hosmer's two-out, two-run jab through the right side of the infield gave Kansas City a 3-1 lead.
Murphy went deep in the fourth inning before Washington continued its rally in the sixth, but the Royals hung around long enough to deliver their second walk-off win of the season.
The result? Two clubs on wildly different trajectories changed directions.
The Nationals began their 10-game road trip with a three-game sweep in St. Louis, and were an inning away from being perfect at the midway point. Meanwhile, the Royals (14-12) avoided dropping back to .500 after a hot start to the defense of their World Series championship.
''I don't know what to say,'' Nationals manager Dusty Baker said. ''Tanner pitched a great game. We got some hitting, some home runs. Their speed got us. That's what they do. That's what they do in this ballpark. They certainly know how to come back. I've seen them come back many, many times. Boy, that's real tough.''
NATIONALS VISIT HALL
Several members of the Nationals, including NL MVP Bryce Harper, spent the morning visiting the Negro Leagues Baseball Museum. Harper called it ''an honor and pleasure'' to visit the museum and its president, Bob Kendrick. The museum is a popular spot for visiting teams to spend time in Kansas City.
HARPER INKS WITH UA
Under Armour announced Tuesday that Harper had signed a multiyear extension with the company, likely one of the largest endorsement deals in the majors. Harper has endorsed the brand the last five years. His new line of baseball cleats, ''Harper One,'' will be available in July.
Moustakas got the night off from the field after aggravating a thumb injury in Seattle over the weekend. ''It blew up in Seattle,'' manager Ned Yost said. ''It's just a day-by-day thing. We'll see how he feels tomorrow. Yesterday it was really swollen.''
The series concludes Wednesday when Nationals RHP Stephen Strasburg, 4-0 for the first time in his career, takes on Royals RHP Kris Medlen. The afternoon game is ''School Day at the K.''