ST. LOUIS (AP) Carlos Martinez waited longer than he expected before earning his first victory of the season.

Martinez pitched effectively into the eighth inning and the St. Louis Cardinals once again beat Wily Peralta, topping the Milwaukee Brewers 2-1 on Tuesday night.

''I've been working really hard and I've always had faith in myself and my team and I knew that it was going to come eventually,'' Martinez said through a translator. ''But I really worked hard for this, so it feels great.''

Martinez (1-3), making his sixth start of the season, retired the first 12 batters. He gave up an unearned run and four hits in 7 1/3 innings, striking out four and walking one.

''Carlos was as good as we've seen him,'' manager Mike Matheny said. ''That was complete-game-shutout stuff and really got into a good rhythm. Their seventh, got a little excited, I think, once he got a couple of outs and changed that rhythm a little bit. But he did a great job of getting it back together. Just a big day. Their guy (Peralta) pitched well, too, and they just kind of matched up. Carlos was everything we needed.''

Trevor Rosenthal pitched a perfect ninth for his third save in as many chances.

Peralta (4-2) fell to 0-9 in his last 11 starts against the Cardinals. He allowed two runs in 5 1/3 innings and tied his season high with seven strikeouts.

''Both guys definitely had their A-stuff tonight for sure,'' Brewers manager Craig Counsell said. ''I thought when Wily started the game, it was as good as we've seen from him. It was good velocity, his slider was good, he was pitching very, very well. And, obviously, Martinez it was a little different. It wasn't a big strikeout night, but he had lots of groundballs for sure.''

Matt Carpenter, Stephen Piscotty and Wong each had two hits - accounting for all six of the Cardinals' hits.

It was scoreless when Carpenter led off the sixth with a single and Piscotty had a one-out double. Yadier Molina had a sacrifice fly off reliever Jacob Barnes and Wong singled with two outs for a 2-0 lead.

Wong, who had a baserunning blunder and a fielding error in the Cardinals' 7-5, 10-inning loss on Monday, extended his hitting streak to eight games. He's batting .423 (11 for 26) during the streak.

''Obviously, there are going to be nights like I had last night which you want to forget and that's what I did,'' Wong said. ''I accepted the fact I had a bad night, forgot about it, came in today and did my job.''

The Brewers scored in the seventh when Domingo Santana single off Martinez's glove, Nick Franklin reached on a fielding error by Carpenter at first base and Jett Bandy singled.

TRAINER'S ROOM

Brewers: LF Ryan Braun (right trapezius soreness) was not in the lineup for the second consecutive game, but did pinch hit in the ninth inning. He remains day to day.

Cardinals: LHP Tyler Lyons (right intercostal strain) was placed on the 10-day disabled list and RHP Sam Tuivailala was recalled from Triple-A Memphis.

UP NEXT

Brewers: RHP Chase Anderson (2-0, 2.10) is 7-1 with a 2.41 ERA over his last 17 starts dating to last season. He is 0-2 with a 1.97 ERA in six career starts against the Cardinals.

Cardinals: RHP Adam Wainwright (2-3, 6.12) is 15-8 with a 2.19 ERA and six complete games in 29 career starts and 36 appearances against the Brewers.

More AP baseball: https://apnews.com/tag/MLBbaseball

Copyright 2017 by Associated Press. Any commercial use or distribution without the express written consent of Associated Press is strictly prohibited.