SAN DIEGO _ All the Padres needed was a base hit and a booted ball to finally create a happy ending on an historic night.
Wil Myers, who began the bottom of the 10th inning on second base, scored the winning run from there when Rangers center fielder Scott Heineman overran Jake Cronenworth's single.
That was the anticlimactic ending to an 8-7 victory that was filled with drama, as the Padres' second straight extra-innings victory was their fourth straight victory over the Rangers this week.
Texas seemed intent on spoiling history, as Nick Solak's home run in the top of the ninth tied the game 7-7.
Eric Hosmer's drive that bounced off the top of Petco Park's right field wall in the fifth inning made the Padres the first major league team ever to hit a grand slam in four consecutive games.
It also got back a lead for the Padres, one that was going to be up to a beaten-down bullpen to protect for four innings.
That the relievers failed to do so again _ twice _ was seemingly made a footnote when Ty France and Austin Hedges hit back-to-back home runs in the eighth inning.
But Solak drove the second pitch from Emilio Pagan in the ninth inning over the same right field wall where Hosmer's historic blast had landed.
Pierce Johnson finally put a plug in the leak, stranding runners at the corners in the top of the 10th.
The Padres took a 1-0 lead in the first inning in a quite unusual manner for them _ by manufacturing it.
Myers followed successive two-out walks by Manny Machado and Hosmer by grounding a single off third baseman Todd Frazier's glove, bringing Machado home from second base.
It broke a streak of 20 runs _ all six Wednesday, all six Tuesday and their final eight on Monday _ that had come via the homer.
Of their previous 61 runs, 47 had come on homers.
Hosmer got them back on the power track.
Machado walked after singles by Hedges and Tatis, and Hosmer strode to the plate with the chance at history.
The night before, Machado's walk-off slam in the 10th inning had given the Padres grand slams in three consecutive games for the first time in franchise history. They were the first major league team to accomplish the feat in 14 years.
Myers hit one in the first inning Tuesday, and Fernando Tatis Jr.'s slam heard 'round the world in the eighth inning Monday started the run.
Hosmer's ball, was hit fairly low and just deep enough to sail over right fielder Joey Gallo and caromed off the cement topping the wall.
Before the ball even bounced, the screams from the Padres dugout and suites where a smattering of employees sit to watch games mixed with the canned crowd noise as Hosmer began his trot and Hedges, the runner on third base, crossed the plate with four fingers held high.
It was Hosmer's third career grand slam, and it was his third extra-base hit in five at-bats with the bases loaded this season. He doubled twice with the bases loaded in the season opener.
It was the Padres' fifth grand slam of the season, making them one of three teams (1996 Montreal Expos, 2018 Boston Red Sox) to ever hit five grand slams through their first 27 games. Machado's grand slam on Aug. 11 in Los Angeles was the Padres' first of the season. Just two other teams (Expos in '96, New York Mets in 2006) have ever hit five grand slams in a 10-day span.
In the top of the fifth inning, Dinelson Lamet had lost his no-hitter and the Padres' lead.
Isaiah Kiner Falefa's single to left field was followed on the next pitch by Jose Trevino's home run to the seats beyond left field.
That gave the Rangers a 2-1 lead, and Lamet was gone by the time the sixth inning began. He struck out nine while allowing two runs for just the second time this season and two earned runs for the first time.
Thursday was the fourth straight start in which Lamet didn't allow a hit for at least three innings and the third time in four starts he didn't allow a hit through four innings.
The difference this time was his command wasn't what it had been, and the Rangers made him work by being selective and fouling off some of his tougher offerings. He walked three and threw just 60 strikes among his season-high 97 pitches.
Tim Hill, who got the win Wednesday night when he pitched the 10th inning, relieved Lamet and worked a perfect sixth and got the first out of the seventh.
Michel Baez, called up on Wednesday, took over and loaded the bases on two singles, a walk and Cronenworth's throwaway while attempting to turn what would have been an inning-ending a double play.
Baez certainly had his pitches sail to places in the strike zone he did not intend, but he would have escaped the inning if Danny Santana's fly ball to the wall in center field had not gone off the heel of Trent Grisham's glove. Grisham, who entered the game leading National League centerfielders with four defensive runs saved, ran a long way to track down the ball and appeared to have it when he leaped off the warning track, but it bounced away from him as all three baserunners scored uncontested.
Those were gaffes the Padres could ill-afford with their bullpen having been so strained for so many days.
Rookie Luis Patino replaced Baez and got the final out of the seventh before giving up a leadoff single to Joey Gallo and, with one out, barely hitting Derek Dietrich on what must have been a string hanging off his elbow pad. A fly ball to right field was the second out before Trevino lined a single to left field to score Gallo.