SAN DIEGO (AP) — Jurickson Profar hit a three-run homer in the eighth inning, and the San Diego Padres beat the Minnesota Twins 7-5 on Tuesday night. Manny Machado also went deep as San Diego won its second straight against Minnesota in a matchup of playoff contenders. Jake Cronenworth had two hits and scored two runs.

The Padres trailed 5-3 before Profar drove a low slider from Steven Okert (3-2) deep to left. Donovan Solano and Luis Arraez singled ahead of Profar's 20th homer. Xander Bogaerts tacked on an RBI double against Ronny Henriquez, giving San Diego a 7-5 lead.

Tanner Scott (8-5) got the win despite allowing two runs and four hits in the eighth. Robert Suarez handled the ninth for his 29th save. The red-hot Padres improved to 22-5 in their last 27 games.

They have won nine of their last 10 series. Ryan Jeffers had two hits and two RBIs for Minnesota in its third consecutive loss. Carlos Santana had two hits and scored two runs.

The Twins grabbed a 5-3 lead on Christian Vázquez's pinch-hit single off Scott. Vázquez's liner to left drove in Royce Lewis and Santana. Twins right-hander Bailey Ober was charged with three runs and four hits in six-plus innings.

Ober was working with a 3-1 lead before he surrendered Machado's two-run homer in the seventh. The drive to center was Machado's 20th homer of the season. San Diego jumped in front when Jackson Merrill doubled and scored on David Peralta’s two-out single in the second.

But Minnesota responded with two runs .