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.

"Find ways to win ballgames, even when you're not hitting doubles or homers,” Washington's Trea Turner said.

That's exactly what the Nationals managed to do after entering the eighth trailing 2-1.

Gallegos (2-1) walked a batter, then hit one, before 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 favour of an extra infielder, Edmundo Sosa. That left the Cards with only a pair of corner outfielders — the sort of setup rarely seen at all, but more likely to be deployed in the ninth or later.

“Effectively, that's an extra-inning situation, to some degree. ... We're trying to keep them off the board,” Shildt said, noting that Castro tends to hit ground balls that could lead to a double play.

“We don’t use it a lot,” Shildt said about the five-man infield. “I don’t believe we've used it since I've been here. You just be ready when the time presents itself, and we were ready.”

Hey, Nationals manager Dave Martinez, you ever seen that before in the eighth?

“That’s the first time,” was Martinez's reply.

Still, 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.

“Hopefully we can play well and kind of survive without him,” Turner said.

As for sticking with Gallegos once he'd run into some real trouble and already faced the minimum three batters, Shildt said: “At that point, it's his game. You trust Gio. Gio’s been one of our best guys for three years. You can't hit the proverbial panic button. ... He pretty much was a pitch away from getting out of the jam.”

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.

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. He came in with a 21.32 ERA this season but cut that roughly in half.

The left said afterward he wanted “to get back to myself.”

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.

Wainwright 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.

“I didn’t feel any different than I've been feeling,” Wainwright said after season bests in Ks and innings. “I just executed better.”

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 centre to make it 1-all.

Austin Dean's sacrifice made it 2-1.

And then came the eighth.

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