SAN DIEGO — Kyle Higashioka’s solo homer started a five-run rally against an ailing Max Fried with two outs in the second inning, and the San Diego Padres held on to sweep the Atlanta Braves with a 5-4 victory in Game 2 of their NL Wild Card Series on Wednesday night.

Manny Machado added a two-run double with the bases loaded and Jackson Merrill, a top contender for NL Rookie of the Year, followed with a two-run triple as the sellout crowd of 47,705 — the largest in Petco Park history — roared.

The Padres, who would love to win a World Series title in memory of late owner Peter Seidler, head up Interstate 5 to face Shohei Ohtani and the NL West rival Dodgers in a National League Division Series beginning Saturday evening at top-seeded Los Angeles.

San Diego eliminated the 111-win Dodgers in a 2022 NLDS.

Robert Suarez pitched a perfect ninth for the save. As soon as Higashioka caught pinch-hitter Travis d’Arnaud’s foul pop for the final out — the catcher had to step over first baseman Donovan Solano, who also went for it — the crowd started chanting “Beat L.A.!”

“This team’s always shown the ability to be resilient and never quit,” Higashioka said. “That’s a credit to all the guys. Just putting together good at-bats no matter what.”

Fried and Padres starter Joe Musgrove exited early with injuries. Fried left after the second inning. He was hit on the left hip by a ball off the bat of Fernando Tatis Jr. two batters into his outing. Musgrove left with right elbow tightness with two outs in the fourth after throwing two slow curveballs to Matt Olson.

Padres manager Mike Shildt didn’t have a postgame update on Musgrove, other than to say it was the same area of the elbow that sidelined the big right-hander earlier this season.

“Fortunately, we had the lead,” Shildt said. “His leaving with two outs in the fourth was a challenge, but we found solutions and the bullpen was rested and played its part to bring it home.”

After the Padres took a 5-1 lead in the second, Jorge Soler hit a solo homer in the fifth and Michael Harris II had a two-run shot in the eighth.

Fried, who took the loss, got out of a bases-loaded jam in the first. He then allowed five runs on six straight hits with two outs in the second.

“I think the longer he was out there, the worse it got,” Braves manager Brian Snitker said.

Dylan Lee took over for Atlanta to begin the third.

Brewers 5, Mets 3: Jackson Chourio tied the game in the eighth with his second homer of the night and Garrett Mitchell delivered a two-run shot later in the inning to give the Milwaukee Brewers a victory over the New York Mets on Wednesday that evened their NL Wild Card Series. The teams will play a decisive Game 3 on Thursday night. The Brewers will attempt to become the first team to rally win a best-of-three Wild Card Series after losing the opener since MLB went to this expanded playoff format in 2022. Milwaukee trailed 3-2 when Chourio led off the eighth by homering to right-center off losing pitcher Phil Maton, making his fourth appearance on the mound in five days.