Jack Flaherty won a fourth straight start for the first time in two years, and the St. Louis Cardinals beat Washington 8-4 on Sunday to open the second half by taking two of three from the Nationals.

Paul Goldschmidt hit a two-run homer and Nolan Gorman had three hits and two RBIs for St. Louis.

Flaherty (7-5) allowed three runs, three hits and three walks in six innings with seven strikeouts. He had not won four starts in a row since an 8-0 stretch from April 7 to May 19, 2021.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Jack Flaherty throws pitch

St. Louis Cardinals starting pitcher Jack Flaherty throws during the first inning of a baseball game against the Washington Nationals Sunday, July 16, 2023, in St. Louis.  (AP Photo/Jeff Roberson)

"Good things happen when you get ahead," Flaherty said. "A lot of things that I’ve been trying to work on and get better throughout the year, from getting ahead and fastball command, I did a lot better job of that today."

His hot streak this year followed a slump in which he went 0-1 over five starts.

"Jack, he was on the attack from the first inning," Cardinals manager Oliver Marmol said. "His stuff looked really good. Commanded the fastball extremely well, got a lot of swing and miss on the curveball, miss on the slider and changeup."

Chris Stratton pitched a perfect seventh and Kyle Leahy relieved after a 38-minute rain delay. Leahy got one out and JoJo Romero the final five for the Cardinals, who are last in the NL Central at 40-53.

"We just got to play well every day and put a bunch of wins together," Goldschmidt said. "So, if we do that, we got a chance."

REDS' DAVID BELL LOSES HIS COOL AT UMPIRE DURING GAME VS BREWERS

Paul Goldschmidt is congratulated by Brendan Donovan

St. Louis Cardinals Paul Goldschmidt (46) is congratulated by teammate Brendan Donovan (33) after hitting a two-run home run during the sixth inning of a baseball game against the Washington Nationals Sunday, July 16, 2023, in St. Louis.  (AP Photo/Jeff Roberson)

Nationals All-Star Josiah Gray (6-8) gave up four runs and 10 hits in five innings.

"He had traffic from the first inning on," Nationals manager Dave Martinez said. "He couldn’t really establish his fastball today, he threw a lot more sliders, a lot more cutters. He got out of some jams you know and gave us all he had for five innings. You know, I thought that was enough. He had 95 pitches."

Keibert Ruiz homered in the second, ending Flaherty’s 13 2/3 innings scoreless streak.

Run-scoring singles by Andrew Knizner, Brendan Donovan and Lars Nootbaar in the fourth built a 3-1 lead for St. Louis, which had gone 0 for 8 with runners in scoring position.

JOHNNY BENCH APOLOGIZES FOR 'INSENSITIVE' COMMENT AT REDS CEREMONY

Nolan Gorman tosses bat after hitting home run

St. Louis Cardinals Nolan Gorman (16) tosses his bat after hitting a solo home run during the fifth inning of a baseball game against the Washington Nationals Sunday, July 16, 2023, in St. Louis.  (AP Photo/Jeff Roberson)

Gorman homered in the fifth.

"He’s taking much better at-bats," Marmol said of Gorman. "Today was another good day for him. He’s staying on the ball well. Even on the flyouts, you can tell he’s staying through the zone a lot better."

Dominic Smith had a two-run double to shallow center in the sixth that just eluded Nootbar’s attempt for a diving, backhand catch, cutting the Nationals’ deficit to 4-3.

Goldschmidt hit a 443-foot drive to center in the sixth off Jordan Weems, Alec Burleson had an RBI groundout and Gorman added a run-scoring single for an 8-3 lead.

Abrams doubled and scored on Ruiz’s groundout in the eighth.

REDS' JOHNNY BENCH APPEARS TO MAKE ANTISEMITIC REMARK AT TEAM CEREMONY

Lars Nootbaar is congratulated by Jack Flaherty

St. Louis Cardinals Lars Nootbaar, left, is congratulated by teammate Jack Flaherty (22) after hitting a solo home run during the first inning of a baseball game against the Washington Nationals Friday, July 14, 2023, in St. Louis.  (AP Photo/Jeff Roberson)

"We had a good series there," Flaherty said. "We were a couple of pitches away from taking all three. We’ll take this one, build on it and move on to the next one."

ROSTER MOVES

St. Louis activated Knizner (right groin) from the 10-day injured list, optioned 1B Luken Baker to Memphis and returned RHP James Naile to the Triple-A farm team. Naile was the team’s 27th player in Saturday’s doubleheader.

TRAINER’S ROOM

Nationals: 3B Jeimer Candelario was a late scratch and missed his second straight game after bruising a bone in his right thumb Friday night. ... RHP Hunter Harvey was (right forearm soreness) was sent back to D.C. to get an MRI. He got a save in Saturday’s opener.

Cardinals: RHP Adam Wainwright (right shoulder strain) is expected to throw a bullpen session on Monday.

CLICK HERE TO GET THE FOX NEWS APP

Lars Nootbar, Dylan Carlson, and Alec Burleson celebrate

St. Louis Cardinals Lars Nootbaar, left, Dylan Carlson and Alec Burleson, right, celebrate an 8-4 victory over the Washington Nationals following a baseball game Sunday, July 16, 2023, in St. Louis.  (AP Photo/Jeff Roberson)

UP NEXT

Nationals: LHP MacKenzie Gore (4-7, 4.42 ERA) is to start Monday’s opener of a three-game series at the Chicago Cubs, who counter with LHP Drew Smiley (7-6, 4.31 ERA). It will be Gore’s first start at Wrigley Field.

Cardinals: RHP Miles Mikolas (5-5, 4.12) starts Monday’s opener of a three-game series against visiting Miami, which send LHP Jesús Luzardo (8-5, 3.29 ERA) to the mound.