Top of the National League East, the Nationals edged the Arizona Diamondbacks 3-2 for their ninth straight win.
Anthony Rendon - scheduled to have a day off after playing 62 straight games - delivered the walk-off single as the pinch hitter.
The nine-game winning streak is the second longest in the franchise's history, while the victory was their fourth walk-off win in the past five games.
The Pirates needed a sacrifice fly from Gaby Sanchez to complete a 3-2 walk-off win over the Atlanta Braves.
Jeff Samardzija gave up two homers in a five-run third inning as his Oakland Athletics were beaten 8-5 by the New York Mets.
In contrast, Rick Porcello had a three-hit shutout as the Detroit Tigers thrashed the Tampa Bay Rays 6-0.
The Baltimore Orioles remain in control of the American League East after a 4-3 win over the Chicago White Sox left them nine games clear.
Matt McBride smashed a grand slam in the sixth as the Colorado Rockies beat the Kansas City Royals 5-2.
The Philadelphia Phillies overcame the Seattle Mariners 4-3 and the Toronto Blue Jays' offense finally got going again in a 9-5 victory over the Milwaukee Brewers.
A four-run seventh set up the Houston Astros' 5-2 win against the New York Yankees, while a five-run fifth helped the Los Angeles Angels past the Boston Red Sox 8-3.
The St Louis Cardinals eased past the Cincinnati Reds 7-3 and the San Francisco Giants crushed the Chicago Cubs 8-3.
The Texas Rangers scored five times in the first two innings on their way to a 5-4 win over the Miami Marlins.
The Cleveland Indians claimed a 5-0 victory against the Minnesota Twins and the San Diego Padres were 4-1 winners against the Los Angeles Dodgers.