Washington's Yan Gomes drew a four-pitch walk from Giovanny Gallegos to force in the go-ahead run in an odd eighth inning that also featured St. Louis deploying a five-man infield, and the Nationals came back to edge the Cardinals 3-2 on Tuesday night.

St. Louis led 2-1 entering the eighth. But Gallegos (2-1) walked a batter, then hit one, before Trea Turner's RBI single to right on an 0-2 count tied the game.

One out and one intentional walk later, Gallegos faced Starlin Castro with the bases full, and Cardinals manager Mike Shildt removed an outfielder he had just inserted in the middle of the inning in favor of an extra infielder, Edmundo Sosa. That left the Cards with only a pair of corner outfielders.

St. Louis Cardinals' Yadier Molina, left, is greeted by Austin Dean (0) after he scored on a triple by Dylan Carlson during the seventh inning of the team's baseball game against the Washington Nationals, Tuesday, April 20, 2021, in Washington. (AP PhotoNick Wass)

St. Louis Cardinals' Yadier Molina, left, is greeted by Austin Dean (0) after he scored on a triple by Dylan Carlson during the seventh inning of the team's baseball game against the Washington Nationals, Tuesday, April 20, 2021, in Washington. (AP PhotoNick Wass)

The strategy worked out fine, because Gallegos got Castro looking at strike three on a 94 mph fastball. But then came the free pass to Gomes that put the hosts ahead — and gave them a win on a day they put slugger Juan Soto on the 10-day injured list with a strained left shoulder.

Daniel Hudson (2-0) threw a perfect eighth for the win, and Brad Hand pitched the ninth for his second save in two chances with Washington.

It was the Cardinals’ first one-run game all season; every other club in the majors already had participated in at least two.

Washington Nationals' Josh Bell (19) returns to the dugout after hitting a home run during the sixth inning of the team's baseball game against the St. Louis Cardinals, Tuesday, April 20, 2021, in Washington. (AP PhotoNick Wass)

Washington Nationals' Josh Bell (19) returns to the dugout after hitting a home run during the sixth inning of the team's baseball game against the St. Louis Cardinals, Tuesday, April 20, 2021, in Washington. (AP PhotoNick Wass)

Both starting pitchers performed well, but neither factored in the decision.

Washington's Patrick Corbin tossed six scoreless innings, removed with a 1-0 lead despite having thrown merely 76 pitches.

St. Louis' Adam Wainwright struck out 10 while allowing one run in seven innings and left with a 2-1 lead. The only blemish: Josh Bell, who was batting .115, hit his first homer for the Nationals on a first-pitch curveball in the sixth.

Washington Nationals center fielder Victor Robles misses the ball on a triple by St. Louis Cardinals' Dylan Carlson during the seventh inning of a baseball game Tuesday, April 20, 2021, in Washington. (AP PhotoNick Wass)

Washington Nationals center fielder Victor Robles misses the ball on a triple by St. Louis Cardinals' Dylan Carlson during the seventh inning of a baseball game Tuesday, April 20, 2021, in Washington. (AP PhotoNick Wass)

He finished with a flourish, too, striking out his last four batters, including pinch-hitter Yadiel Hernández looking at — what else? — a curveball to close the seventh.

When the bullpens got involved is when things really got interesting.

Corbin's replacement, Tanner Rainey, walked Yadier Molina after a 10-pitch at-bat, then gave up rookie Dylan Carlson's triple off the wall in center to make it 1-all. Austin Dean's sacrifice made it 2-1.

MAKING MOVES

The Nationals recalled right-handed pitcher Steven Fuentes before the game and optioned righty Ryne Harper to the alternate training site. It's the first time in the majors for the 23-year-old Fuentes, who spent time at Class A Potomac and Double-A Harrisburg in 2019. Harper allowed one earned run in three innings of relief with Washington.

TRAINER'S ROOM

Nationals: Soto, the reigning NL batting champion, originally was listed in Tuesday's starting lineup. He was replaced in right field by Andrew Stevenson. Yadiel Hernandez was recalled from the alternate training site to replace Soto on the 26-man roster. ... LHP Seth Romero, a 2017 first-round draft pick who turned 25 on Monday, hurt his ribs throwing a pitch about a week ago at the alternate training site and is “going to be out for a while,” manager Dave Martinez said.

UP NEXT

The series wraps up Wednesday afternoon with Washington sending three-time Cy Young Award winner Max Scherzer (0-1, 2.37 ERA) to the mound to face Cardinals RHP Carlos Martínez (0-3, 7.80). Scherzer is 2-6 with a 3.31 ERA in 11 career starts against St. Louis.

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP_Sports