SAN FRANCISCO (AP) An 11-game losing streak wore on the San Francisco Giants, who had chances in many of those games and wound up on the wrong end.

Chris Stratton's first career shutout couldn't have come at a more opportune time to get his club out of a deep, weeks-long funk.

Stratton pitched a two-hitter, Austin Slater backed him with a two-run single, and San Francisco snapped its longest skid since 1951 by beating the Colorado Rockies 2-0 on Friday night.

''We're trying to get wins. We're not giving up,'' Stratton said. ''It's just kind of been a tough little go right now but we're doing all we can to win games.''

The NL West-leading Rockies had their division lead trimmed to a half-game over the Los Angeles Dodgers, who won at St. Louis. Colorado had its seven-game winning streak against San Francisco snapped.

Stratton (10-9) struck out seven and walked two, throwing 114 pitches to finish the 2-hour, 20-minute game. He allowed only one baserunner to reach second with Trevor Story getting there in the second.

''We just couldn't seem to square it up consistently,'' Rockies manager Bud Black said.

The right-hander has a career high in victories and became the Giants' first pitcher with double-digit wins since 2016 when Johnny Cueto, Madison Bumgarner and Jeff Samardzija got there. Those three star pitchers have dealt with injuries this season.

Stratton, who worked with former Giants righty Ryan Vogelsong when sent back down to Triple-A Sacramento and will be a contender for the rotation in 2019, retired nine straight during one stretch then his final 12 batters. He pitched the first Giants' shutout since Samardzija on Aug. 28, 2017, against San Diego.

While ending the longest skid of Bruce Bochy's managerial career - he had a nine-game losing streak with San Diego in 2003 - the Giants earned their first victory this month.

''It's great get off the schneid. I'm not going to lie, it wears on you, it does,'' Bochy said. ''It was one of those streaks, it's hard to believe we were in the streak, to be honest, because we were in so many games.''

The Giants ended their worst winless stretch since moving to San Francisco. They avoided what would have been just the fourth losing streak of 12 or more games in franchise history since 1883. They did so in 1944 with a 13-game skid and also in 1902 and 1900 - all of them while playing in New York.

Tyler Anderson (6-9) hasn't won in 12 starts since beating the Giants on July 4, going 0-6 during that span with Colorado posting a 2-10 record during his outings.

Anderson's wild pitch in the second put runners on second and third before Slater's single. Anderson then struck out the side in order the next inning.

''If I don't throw a wild pitch there, we might still be playing,'' he said. ''I might throw a double-play ball and we could still be going. But overall, in general, better.''

He allowed two runs on seven hits in six innings, struck out six and didn't walk a batter.

''Tyler threw the ball much better,'' Black said. ''I think you saw the command.''

GIANTS MOVE

San Francisco dismissed seventh-year strength and conditioning coach Carl Kochan in what could be the beginning of a series of moves as another losing season winds down.

TRAINER'S ROOM

Giants: 1B Brandon Belt exited in the top of the seventh and said afterward his tender right knee ''just got worse.'' He said he might need more days off, and Bochy agreed it could be necessary. ''I'm concerned there,'' Bochy said. ''We've got to be smart about this and see where he's at. You get caught in a diminishing return area, where you're starting a guy then he has to come out of the game.'' Belt felt considerable discomfort all day and said it won't be right until he undergoes an offseason arthroscopic ''cleanup'' procedure - something he also did after the 2015 season. ... SS Brandon Crawford is encouraged his sore left knee has made progress the past four or five days. ''Hopefully finish strong,'' he said. ... 3B Pablo Sandoval, recovering from right hamstring surgery, is happy to be back around the team. He's doing cardio work in his rehab for now, not yet able to lift weights yet. ''I feel great,'' he said. Sandoval hopes to be fully ready by spring training.

UP NEXT

Rockies: RHP German Marquez (12-9, 3.94 ERA) is on a run of nine straight quality starts, Colorado's longest streak since Ubaldo Jimenez had a franchise-best 14 straight in 2010.

Giants: LHP Bumgarner (5-6, 3.30) hasn't allowed a run in his past 14 innings at home dating to Aug. 7.

---

More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.