Eric Hartline-USA TODAY Sports

Luis Garcia had two hits and two RBIs, Yadiel Hernandez added three hits and an RBI and the Washington Nationals rallied for a 3-2 victory over the host Philadelphia Phillies on Wednesday.

Juan Soto returned from a left calf strain and contributed two hits for the Nationals, who snapped a six-game losing streak.

Washington starter Josiah Gray (7-5) allowed four hits and two runs in six innings to go along with a career-high 11 strikeouts and just one walk.

Tanner Rainey pitched a scoreless ninth inning to earn his 12th save in 16 chances.

Kyle Schwarber went 3-for-4 with two home runs for Philadelphia. He became the first Phillie since Chase Utley in 2006 with consecutive multi-homer games.

Phillies starter Aaron Nola tossed 7 2/3 innings and gave up seven hits and three runs. Nola (5-6) struck out three and walked one.

Soto recorded the Nationals' first hit, a one-out single to center field in the fourth. Josh Bell grounded out to first and Hernandez followed with an RBI double for a 1-0 lead.

The Phillies tied the game at 1 in the bottom of the fourth when Schwarber launched a solo homer to right.

Schwarber led off the sixth with another solo homer to right, his 27th of the season, for a 2-1 advantage. It was the 19th career multi-homer game of Schwarber's career and the fifth this season.

In the seventh, Bell grounded out and Hernandez then hit a check-swing single. Keibert Ruiz followed with a single and Garcia hit a two-run double to center for a 3-2 lead.

Hernandez opened the ninth with a double off Corey Knebel. But Knebel proceeded to retire the next three batters.

In the bottom of the ninth, Darick Hall struck out, J.T. Realmuto flied out to right and Didi Gregorius struck out to end the game.

More must-reads:

TODAY'S BEST
Pacers ride historic shooting performance to Game 7 blowout of Knicks
Timberwolves mount incredible second-half comeback to stun Nuggets in Game 7
Xander Schauffele proves doubters wrong with historic win at 2024 PGA Championship
Four things we learned from Joey Logano's All-Star Race win at North Wilkesboro
Phil Foden lifts Manchester City to fourth consecutive English Premier League title
Watch: Aaron Judge blasts 13th home run in Yankees' seventh straight win
Canucks won't have linchpin forward for Game 7 vs. Oilers
Jags reportedly mulling extension for Trevor Lawrence, but is that the right choice?
Gordon Hayward calls role with Thunder 'frustrating'
Mets reliever Edwin Diaz showing short shelf life of closers
Three offseason moves the 49ers must make
Watch: NASCAR drivers exchange punches after crash in All-Star Race
Knicks star offers passionate defense of HC Tom Thibodeau after Game 7 loss
Knicks' Jalen Brunson suffers serious injury in Game 7 vs. Pacers
Dodgers add recently acquired left-hander to active roster
Report: 2023 No. 7 pick expected to terminate KHL contract, join Flyers
Mavericks advance to Western Conference Finals aided by controversial call late
Connor McDavid, Oilers hammer Canucks to force Game 7
Tyson Fury-Oleksandr Usyk epic increases excitement for potential rematch
Seize the Grey wins in muddy Preakness

Want more sports news?

Join the hundreds of thousands of fans who start their day with Yardbarker's Morning Bark, the best newsletter in sports.