MINNEAPOLIS (AP) — Eddie Rosario hit a two-run home run with two outs in the 10th inning, lifting the Minnesota Twins to a 3-1 victory over the San Diego Padres on Wednesday night to maintain their cushion for the second AL wild card spot.

After Joe Mauer hit a one-out single off Phil Maton (3-1), Rosario sent a 2-0 pitch soaring into the right-field seats that stayed just inside the foul pole. He raced around the bases to find a mob of teammates waiting for him at the plate in celebration of the team's fourth walk-off win this season, dumping a bucket of ice on his head after he hit his 23rd homer.

Matt Belisle (2-2) retired all five batters he faced for the Twins, who improved to 15-5 all-time against the Padres.

The Twins took a two-game lead for their spot in the playoffs over the Los Angeles Angels, who played later against the Houston Astros.

Austin Hedges homered for San Diego to tie the game in the eighth inning, but with runners at first and second in the ninth he flied out.

Ervin Santana gave the Twins six scoreless innings, with only three hits and one walk allowed while striking out seven, but manager Paul Molitor pulled him after 93 pitches. Santana has five complete games this season, with 100-plus pitches thrown in 17 of 30 starts.

Trevor Hildenberger, the rookie who has deftly filled a need in the bullpen during the second half since his recall from Triple-A, recorded four outs until Hedges took him deep into the flowers behind the left-center field wall.

Rosario manufactured Minnesota's only run against starter Dinelson Lamet with a leadoff double, advancing on a wild pitch and scoring when Hedges threw wildly past third base and into left field for an error.

But the Twins wasted a bunch of later opportunities to put the game away, with leadoff singles in the fourth, sixth and seventh against Lamet that didn't translate to runs. They had two on with no outs in the fourth, but the biggest whiff was in the seventh. Robbie Grossman grounded into a rare 6-2-3 double play with the bases loaded against Buddy Baumann, before Craig Stammen struck out Brian Dozier.

READY ROOKIE

The Padres have used 13 starting pitchers this year, but Lamet has been a big help. The 25-year-old left-hander from the Dominican Republic, who joined the rotation in late May, has logged 10 straight turns with three or fewer runs allowed, a total of just 16 in that span.

Lamet has 128 strikeouts in 104 innings for a per-nine innings average that entering the game ranked as the fourth-best by a rookie in major league history and third this season in the NL.

His contribution was especially welcomed after right-hander Travis Wood was clobbered for nine hits and nine runs in 2 1/3 innings as the Twins hit seven homers in their 16-0 win. Lamet pitched into the seventh, allowing five hits and two walks with one run while striking out five.

REJOINING THE ROTATION

The Twins reinstated LHP Adalberto Mejia from the DL, where he's been for more than a month because of an upper arm strain. He'll start on Saturday.

TRAINER'S ROOM

Twins: 3B Miguel Sano was "a little sore" after his batting practice session on Tuesday, according to Molitor. Sano has missed 24 straight games with a stress reaction in his left shin, with 17 games remaining in the regular season. "I don't think it's imminent, but he's making progress," Molitor said.

UP NEXT

Twins: RHP Jose Berrios (12-7, 3.94 ERA) starts the opener of a four-game series against Toronto. Berrios is 7-0 in his last seven starts at home, with 47 strikeouts and a 2.45 ERA in 47 2/3 innings with just 34 hits and seven walks allowed. LHP Brett Anderson (3-3, 5.90) takes the mound for the Blue Jays.

More From KROC-AM