ST. LOUIS (AP) — Two pitches turned what looked to be another gem by Carlos Martinez into his first subpar performance of the season.

Clint Robinson and Danny Espinosa homered on consecutive pitches by Martinez in the seventh inning to help the Washington Nationals complete a three-game sweep of the St. Louis Cardinals with a 6-1 victory Sunday.

"He had one of his best fastballs he's had yet," Cardinals manager Mike Matheny said. "Command of his off-speed stuff just one inning got him."

Martinez's counterpart, Max Scherzer, allowed no room for error, pitching seven strong innings to beat his hometown team for the first time.

"That's the best I've seen Max this year," Nationals manager Dusty Baker said. "Sharp with the breaking ball, good velocity. . It was Max's day. Max kept us in the game until our offense did something."

Robinson, Espinosa and pinch-hitter Chris Heisey homered for Washington, providing power on a day when NL MVP Bryce Harper struck out all four times up.

"They made pretty good contact with my fastball," Martinez said through a translator. "You just have to give some credit to them."

Martinez (4-1) needed only 63 pitches to get through his first five innings but was charged with four runs and seven hits in 6 2/3 innings. He walked none and struck out eight, including Harper three times.

Martinez said he was dealing with the flu before the game. He has been dealing with much more than that the past few days.

The right-hander left the Cardinals briefly late last week to address a personal matter. The 24-year-old is the subject of a civil lawsuit filed against him by a woman in West Palm Beach, Florida, near the team's spring training site in Jupiter.

The lawsuit filed in Miami seeks more than $1.5 million and accuses the pitcher of a negligent transmission of a sexually transmitted disease. It seeks actual and special damages along with mental anguish and exemplary damages. It also seeks punitive damages because of outrageous actions.

Martinez's attorney has said the claims are false. The pitcher mostly avoided the issue after the game.

"I'm pretty sure I am healthy and I'm pretty sure I'm feeling good and I'm pretty sure I know who I am, and at the same time this is not part of the job," Martinez said. "That's for my lawyer and agent to take care of."

Scherzer (3-1), who grew up in suburban St. Louis, struck out nine and scattered four singles. He didn't allow a runner past first base, earning his first win in five career starts against the Cardinals.

"I instantly could feel like I was on top of the ball and anytime I needed it the fastball was down at the knees," Scherzer said. "That's when I'm at my best. When I can throw the fastball early in the counts and throw strikes in and away, it just sets up all my stuff."

By finishing the weekend sweep, the Nationals emphatically ended years of frustration at Busch Stadium. It was their first series win in St. Louis since May 2007. Washington improved to 17-7 overall, the best start in club history through 24 games.

The Cardinals have lost four straight and dropped to 5-7 at home this season. St. Louis went 55-26 at home in 2015.

Matt den Dekker snapped Martinez's 16-inning shutout streak with a single in the sixth to score Jose Lobaton, breaking a scoreless tie. The home runs by Robinson and Espinoza quickly turned a one-run game into a 4-0 Nationals lead.

Daniel Murphy added an RBI double in the eighth, and Heisey homered in the ninth.

Brandon Moss' opposite-field home run with two outs in the ninth kept the Cardinals from being shut out.

MOLINA KEPT OFF THE BASES

Yadier Molina went 0 for 3, snapping an 11-game hitting streak and an 18-game streak of reaching base safely. Ted Simmons was the last Cardinals catcher to reach base safely in 19 straight when he reached in 30 consecutive games in 1979.

TRAINER'S ROOM

Cardinals SS Jhonny Peralta (thumb) took grounders and threw to first for the first time since his injury in spring training. He also took controlled swings, but there is no specific timetable for his return.

UP NEXT

Cardinals RHP Adam Wainwright (1-3, 7.16 ERA) starts the opener of a four-game series against the visiting Phillies on Monday night. Wainwright helped himself by hitting a three-run triple to earn the win in his last start. Philadelphia will start RHP Jeremy Hellickson (2-1, 3.81).