MINNEAPOLIS (AP) — The Minnesota Twins stumbled home with a bunch of hitters in need of a boost, none more than Max Kepler and his 0-for-29 skid.

The guy who needed a spark the most was the first one to get it going.

Kepler went 3 for 4 with a slump-busting RBI to give the lagging lineup a lift, and the Twins started a vital homestand with a 4-2 victory over the Kansas City Royals on Monday night.

“He’s been as important of a cog in the machine here, since I’ve been, as anyone,” said manager Rocco Baldelli, who witnessed Kepler’s first hit since July 23. He broke his toe the following day, missed 10 games and was fighting through obvious rust upon his return. “We’re going to be looking for really meaningful contributions from him from here on out.”

Jorge Polanco, Jose Miranda and Gary Sánchez each drove in a run for the Twins, who moved within two games of AL Central-leading Cleveland (61-53) after the Guardians split a doubleheader with Detroit. The Twins (59-55) are percentage points ahead of Chicago (60-56) for second place.

“I think we were trying to do too much and carry too much weight as individuals,” Kepler said. “Today we just tried to keep the line moving and trust the guy behind one another.”

Snapping his O-for-August skid with a one-out single in the second inning against Royals starter Kris Bubic (2-7) that scored Polanco, Kepler set in motion a productive night. The Twins were 0 for 18 with runners in scoring position over their previous two games and 1-4 on the road trip last week to fall out of first place for the first time in nearly two months.

“We know he was going through a rough stretch, but it’s part of baseball,” Miranda said. “We all go through up and downs. When he got his first one, it was good. We all got happy, and he got two more, which was great.”

Joe Ryan (9-5) pitched 5 1/3 innings for the win, deftly recovering from a two-run home run by thriving rookie Vinnie Pasquantino in the first inning.

Caleb Thielbar relieved him with a 3-2 lead and runners at second and third, retiring pinch-hitter Brent Rooker on a shallow pop fly and striking out pinch-hitter Michael A. Taylor to end that threat. Thielbar pumped his first and uncharacteristically screamed in exhilaration after retiring Taylor to preserve the lead. Thielbar has 13 strikeouts in his last 10 1/3 innings, without an unearned run.

“He’s been really, really freaking good,” Baldelli said. “When you send him out there in the most important spots, you expect him to go out there and get the job done.”

New Twins closer Jorge López, who blew his last two save chances, gave up a double and a single in the ninth inning before escaping with a game-ending double play grounder by M.J. Melendez.

This was the time for the Twins to get going, the first of 13 home games in a 17-day stretch through the end of the month — all against opponents that started the week at the .500 mark or worse.

The Royals brought a much better vibe than a team that’s 48-69, with seven rookies in the starting lineup — their most in a game since 1991 — giving them some late-season life.

“Every guy that comes here is ready to make an impact or has already made an impact already,” Bubic said. “It’s exciting to see that, and we’re going to keep riding with them.”

VP STANDS FOR VALUABLE PLAYER

Pasquantino hit four homers over Kansas City’s just-completed 11-game homestand and received the AL Player of the Week award a few hours before first pitch. The 24-year-old, who was an 11th-round draft pick out of Old Dominion in 2019, has quickly earned the Royals’ respect this summer.

“Probably one of the smartest hitters I’ve been around,” Bubic said.

TRAINER’S ROOM

Royals: Hunter Dozier was placed on the paternity list before the game, and Maikel Garcia was recalled from Triple-A Omaha to fill in for the multi-positional player. Dozier traveled to Minnesota with the team, before leaving to be with his wife who has been expecting their third child.

Twins: Polanco hurt his knee sliding into home with the team’s first run. He stayed in for six more innings before being replaced on defense in the ninth. “If he mentions anything to anybody, ever, you know it’s something to pay attention to,” Baldelli said.

UP NEXT

Royals: RHP Zack Greinke (4-7, 4.29 ERA) takes the mound on Tuesday night. He’s coming off his best start of the season, 6 1/3 shutout innings in a win over Chicago last week.

Twins: RHP Sonny Gray (6-3, 3.33 ERA) pitches the middle game of the series. He beat Kansas City on May 29 with six innings, two hits, one run and no walks.