LOS ANGELES (AP) — Shohei Ohtani hit a three-run homer in his postseason debut, Teoscar Hernández’s two-run single gave Los Angeles its first lead in a playoff game in two years, and the Dodgers beat the San Diego Padres 7-5 in their NL Division Series opener Saturday.

Manny Machado’s two-run homer off starter Yoshinobu Yamamoto, also making his first playoff appearance, put Los Angeles in an early 3-0 hole.

Ohtani quickly bailed out the Dodgers with his two-out homer that tied it in the second inning. The Japanese superstar went deep with Hall of Fame pitcher Sandy Koufax looking on and fans chanting “MVP! MVP!” His shot traveled 372 feet to right field, the sellout crowd of 53,028 recording it all on their phones.

“I just really have never seen a guy in the biggest of moments come through as consistently as he has,” Dodgers manager Dave Roberts said. “I wish a lot of other players had that ability. He’s just very unique in that.”

San Diego went ahead 5-3 before the Dodgers rallied with three runs in the fourth.

Tommy Edman scored on a wild pitch by reliever Adrian Morejon, who took the loss. Ohtani had a broken-bat single and later scored, along with Mookie Betts, on Hernández’s single off Jeremiah Estrada that put the Dodgers ahead 6-5.

It was their first lead in a postseason game since the seventh inning of Game 4 against the Padres in a 2022 NLDS. Los Angeles was swept by Arizona in a Division Series last year.

“We need to fight, and that’s what we did,” Roberts said. “Guys in the ‘pen picked us up and the offense was relentless with their at-bats.”

The Dodgers earned their first postseason win since Oct. 11, 2022, in Game 1 of the Division Series against San Diego. They improved to 1-15 in the playoffs when trailing by three or more runs through the first inning.

Down 7-5, the Padres had the potential tying runs on base with two outs in the ninth. Fernando Tatis Jr. singled off Blake Treinen before Jurickson Profar walked to bring up Machado, who struck out swinging. Treinen earned the save.

San Diego also had the potential tying runs in scoring position in the eighth. Michael Kopech issued a leadoff walk to Profar before Machado took a called third strike. Jackson Merrill, a top contender for NL Rookie of the Year, drew a 10-pitch walk.

Dodgers shortstop Miguel Rojas made an over-the-shoulder catch on Xander Bogaerts’ pop fly in shallow left-center before Treinen walked Jake Cronenworth to load the bases. With blue rally towels waving furiously, Treinen struck out Donovan Solano swinging to end the threat.

The Padres’ big three — three-time batting champion Luis Arraez, Fernando Tatis Jr. and Machado — were a combined 4-for-14 with three strikeouts. Tatis’ double in the third registered 118.9 mph off the bat, the hardest-hit ball of his career and the second hardest-hit in the postseason during the Statcast era.

“We didn’t close the door,” Tatis said. “They’re coming alive so we better outscore them. Find a way to make hits happen no matter what.”

It took Ohtani 875 regular-season games to finally reach the playoffs, having spent his first six years in the majors with the Los Angeles Angels, who never had a winning record during his tenure. He finished 2-for-5 with three RBIs, two runs scored and two strikeouts.

“I could really feel the intensity of the stadium before the game began and I thoroughly enjoyed it,” Ohtani said through an interpreter.

Los Angeles made it 7-5 when Edman grounded into a double play that scored Will Smith in the fifth.

The Dodgers’ bullpen delivered six scoreless innings, including 1 2/3 by winning pitcher Ryan Brasier.

The NL West rivals are meeting in the playoffs for the third time in five years. The Dodgers beat the Padres in a 2020 NLDS on their way to winning the World Series in a pandemic-shortened season. The Padres turned the tables in 2022, beating the Dodgers in another Division Series.

Yamamoto, Ohtani’s countryman with whom he teamed to win the World Baseball Classic last year, fell behind 3-0 while throwing 28 pitches in the first. The right-hander has a history of struggling in the opening inning, including his Dodgers debut in the Seoul Series to start the season.

Yamamoto allowed five runs and five hits in three innings. He struck out one, walked three and threw a wild pitch.

Padres starter Dylan Cease, who pitched a no-hitter this season, lasted 3 1/3 innings. He permitted five runs and six hits, struck out five and walked two.

The NL West champion Dodgers had the best record in the majors (98-64) this year, and the wild-card Padres had the top mark after the All-Star break. The Padres took the NL West race down to its final days before the Dodgers won their 11th division title in 12 years. San Diego won eight of 13 meetings to take the season series for the first time since 2010.

Bogaerts gave the Padres a 5-3 lead with a two-run double in the third.

All-Star first baseman Freddie Freeman went 2 for 5 for the Dodgers while playing with a sprained right ankle he sustained last week. He stole second and slid into the bag with his left foot, trying to protect his injury.

“I was holding my breath,” Roberts said.

TRAINER’S ROOM

Dodgers: LHP Clayton Kershaw is done for the season because of a lingering left big toe injury. He said he might need surgery and won’t decide his future until the offseason. … RHP Joe Kelly won’t be available until the World Series, if the Dodgers make it that far. … RHP Brent Honeywell Jr. (cracked fingernail) isn’t available.

UP NEXT

Padres RHP Yu Darvish starts Sunday in Game 2 against his former team. Los Angeles counters with RHP Jack Flaherty, who grew up in the area and attended games at Dodger Stadium as a kid.