Gregory Fisher-USA TODAY Sports

Trevor Williams and three relievers combined on a seven-hitter as the Washington Nationals snapped a five-game losing streak by defeating the visiting St. Louis Cardinals 3-0 on Wednesday.

CJ Abrams homered for the game's first run in the fifth inning, Jeimer Candelario drove in the other two runs and Luis Garcia doubled twice and scored two runs. That production helped the Nationals to their first victory at home in 10 games.

Mason Thompson, Kyle Finnegan and Hunter Harvey worked in relief of Williams as Washington's pitchers posted the team's first shutout of the season. Harvey's one inning resulted in his fourth save of the season.

The Cardinals, who had a four-game winning streak halted, put two runners on base with one out in the eighth inning before the threat was doused. St. Louis, which racked up 17 runs across the first two games of the series, stranded seven runners in Wednesday's game.

Abrams went 3-for-3 to lead Washington's 10-hit attack.

The outcome ruined a strong outing from St. Louis right-hander Miles Mikolas (4-5), who gave up two runs on eight hits in seven innings. He has a personal four-game losing streak.

Williams (4-4) allowed five hits in six innings, striking out four without a walk. He threw 75 pitches, and he's the only Washington starting pitcher with a victory in a span stretching nearly three weeks.

Lars Nootbaar rapped two hits for the Cardinals.

Mikolas retired the first seven batters he faced before consecutive infield singles from Derek Hill and Abrams. Then with two outs in the fifth, Abrams belted his seventh home run of the season.

Garcia and Candelario hit consecutive doubles to begin the bottom of the sixth. Candelario was out on his run-scoring hit while trying to stretch it to a triple.

In the eighth, Garcia doubled, moved to third on Andre Pallante's wild pitch and scored on Candelario's groundout.

Hill made his Nationals debut in place of the injured Victor Robles.

More must-reads:

TODAY'S BEST
Astros 3B breaks out of slump in contract year
Cardinals sign second-round CB
Micah Parsons makes history with new Bleacher Report deal
Celtics assistant named candidate for Lakers HC job
Rudy Gobert fined $75,000 for gesture in Game 4
Former Canadiens GM on Blue Jackets' radar
Cubs designate lefty reliever for assignment
Two-time Super Bowl champ signs with AFC contender
Stars center matches Gretzky feat as Dallas pushes Avalanche to brink
Gritty young Thunder take down veteran Mavericks in Game 4
Cubs acquiring veteran reliever from Mariners
Top-five NBA Draft prospect suffers scary non-contact injury
Hurricanes stay alive with third-period outburst vs. Rangers
Jaylen Brown's big three-pointer gives Celtics 3-1 lead over Cavs
Avalanche star placed in player assistance program
Mercury announce devastating injury on eve of WNBA season
Randy Moss' son makes major football announcement
Reds place key outfielder on injured list with broken thumb
Tom Brady's broadcasting debut set for Week 1 of NFL season
Struggling Cubs reliever placed on injured listÂ