Hernández homered 400 feet to center off Jeremiah Estrada in the seventh for a 3-1 lead.
The Dodgers ended a four-game skid and the Padres' five-game winning streak.
Ramón Laureano homered off Clayton Kershaw (7-2) to give the Padres a 1-0 lead in the first. He sent a hanging curveball 400 feet into left where it hit the foul pole.
Dodgers reliever Alex Vesia hit Jose Iglesias and Jake Cronenworth back-to-back and walked Fernando Tatis Jr. to load the bases in the eighth. Luis Arraez's sacrifice fly cut it to 3-2.
Jack Dreyer got the final out for his second save.
Randy Vasquez (3-6) took the loss.
Key moment
Padres catcher Freddy Fermin crashed into the padded railing in front of the camera well next to San Diego's dugout trying to make a foul catch on Andy Pages. Fermin hit the railing with his chest and the ball was jarred loose. He stayed in the game.
Key stat
Kershaw retired the Padres in order in four innings.
Up next
Padres RHP Dylan Cease (5-10, 4.52 ERA) was set to start Saturday against LHP Blake Snell (2-1, 2.37).
___
AP MLB: https://apnews.com/hub/MLB