SAN DIEGO (AP) Wil Myers and the San Diego Padres went from being one out away from a painful loss to one of the most joyous celebrations of the season.

Myers hit a game-ending three-run homer to cap a seven-run rally with two outs in the seventh inning and give the Padres a 10-7 win against the Seattle Mariners in the first game of a doubleheader. Manny Machado had two homers among his three hits and drove in four runs.

The played the doubleheader after the Mariners voted unanimously not to play Wednesday night as a protest of the shooting of Jacob Blake in Kenosha, Wisconsin. The Mariners have the most Blacks in baseball, eight on the active roster and 11 on the 40-man roster.

San Diego rallied from a 7-3 deficit to stun the Mariners, scoring all seven runs with two outs in the seventh.

Myers watched for a few seconds as his majestic shot sailed well over the left-field fence, tossed his bat and pointed to the Padres' dugout in one motion, and then began his trot. He tossed off his helmet as he approached home and leaped onto the plate and into as wild a celebration.

''That was a lot of fun,'' Myers said. ''I made the last out the last inning and was able to do something there that inning right there. Just all around offensively that last inning was really cool. We never gave up. Down to our last out and we come around and do that. It was really cool all the way around with the win.''

After Craig Stammen allowed four runs in the top of the seventh, Seattle's Taylor Williams (0-1) gave it right back in the bottom of the inning. He gave up a two-run, bases loaded single to Machado. Another run scored on a wild pitch and Eric Hosmer tied it with an RBI single.

Dan Altavilla came on and allowed rookie Jake Cronenworth's single before Myers homered to left, his eighth.

''This is a ton of fun. We've got a great team,'' Myers said. ''We've got a lot of great players here and everybody's doing something, everybody's contributing to help the team win.''

Pierce Johnson (3-1) got the win.

Austin Hedges started the winning rally when he was hit by a pitch, and Trent Grisham and Fernando Tatis Jr. drew walks, ''and then we just went barrel to barrel to barrel and you get it to Wil and you're sitting there first and third and he laid off a pitch and then he got something he could handle,'' manager Jayce Tingler said.

''It's big for Wil but it's just a group of collective men that are pulling for one another. When you have that spirit, it gets contagious and it's something special. Their heart and their grit continue to go and it's everybody picking up one another. You keep playing and magical things can happen.

''To see them get rewarded like that in the seventh inning is pretty meaningful.''

Seattle manager Scott Servais called it ''about as a crazy a last inning that you're going to see in a ballgame in quite some time. We weren't able to close it out. We did a lot of good things offensively in that seventh to put us in a great spot, shut the door. Obviously, (against) a good team on the road, we've got to nail it down at the end and we just weren't able to execute and get it done.''

The Padres had tied the game 3-3 with impressive home runs by Fernando Tatis Jr. and Machado opening the sixth inning. Tatis hit his big league-leading 13th homer an estimated at 448 feet onto the roof of the Western Metal Supply Co. Building in the left-field corner at Petco Park, making him just the second Padres player to homer to the top of the landmark.

Machado followed with a shot into the second deck in left field, his second of the game and ninth this season. Both were off Matt Magill.

Stammen allowed all five batters he faced to reach, including Sam Haggerty, Kyle Lewis and Kyle Seager with RBI base hits. Seager's hit chased Stammen, and Austin Nola hit a sacrifice fly off Johnson.

Until San Diego's impressive home runs, the Padres were trailing a Mariners team getting big contributions from two rookies pressed into duty without much notice. Ljay Newsome pitched four strong innings in his first big league start after Taijuan Walker was traded earlier in the day, and fellow rookie Jose Marmolejos hit a two-run homer after being added as the ''29th man'' for the doubleheader.

Newsome, 23, made the emergency start about three hours after the Mariners announced they sent Walker to the Toronto Blue Jays.

Newsome, making his second big league appearance, retired the first seven Padres batters and 10 of 11 before Machado homered to left-center with one out in the fourth, his ninth. Newsome allowed three hits, struck out four and walked none.

The Mariners took a 3-0 lead off Dinelson Lamet (2-2) in the fourth. Marmolejos, who entered an inning earlier at first base after Evan White left with an injury, homered to left-center with one out and Kyle Seager aboard on a leadoff walk. Jake Fraley singled, stole second and scored on Shed Long Jr.'s single.

Lamet allowed three runs and five hits, struck out six and walked three.

PADRES POINT OF VIEW

Manager Jayce Tingler said that while the Padres have diverse group of players and respected the Mariners decision not to play Wednesday night, they had a different plan of action and wanted to play.

TATIS JR.

Tatis, San Diego's shortstop, committed his first error of 2020, in his 30th game. He committed 18 in 2019, when he was third in voting for NL Rookie of the Year.

TRADE

The Mariners announced the Walker trade about three hours before first pitch. They'll get either a player or cash in return. Walker was 2-2 with a 4.00 ERA in his second stint with the Mariners.

UP NEXT

Mariners: LHP Yusei Kikuchi (0-2, 6.30 ERA) was scheduled to pitch the second game.

Padres: RHP Garrett Richards (1-1, 3.52) got the call for San Diego.

Copyright 2020 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.