Jeff Samardzija and two relievers combined on a three-hitter, Kevin Pillar homered and the San Francisco Giants squeezed past the slumping Colorado Rockies 1-0 on Thursday night.

Samardzija (1-0) went seven innings and outpitched Rockies starter Jon Gray to win for the first time in nearly a year. Colorado has lost six straight and 10 of 11.

The Rockies were shut out for the second time this season and have not held a lead since Chris Iannetta’s 11th-inning homer on April 3 at Tampa Bay.

San Francisco Giants' Kevin Pillar, right, is congratulated by third base coach Ron Woods after hitting a home run off Colorado Rockies' Jon Gray during the seventh inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
San Francisco Giants’ Kevin Pillar, right, is congratulated by third base coach Ron Woods after hitting a home run off Colorado Rockies’ Jon Gray during the seventh inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)

Samardzija permitted three hits, one walk and had a season-high seven strikeouts. Tony Watson retired three batters and Will Smith worked the ninth for his fourth save.

Gray (0-3) was almost as sharp but tied a National League record by allowing a home run in his 15th consecutive start. That was the only blemish on an otherwise crisp night for Gray, who gave up five hits and three walks with six strikeouts.

Samardzija allowed only one runner past first base and retired 10 of the final 11 batters he faced. The right-hander, who missed the final 2½ months last season due to shoulder inflammation, won for the first time since April 20, 2018, when he pitched five scoreless innings to beat the Los Angeles Angels in his first start of the season.

San Francisco Giants' Joe Panik throws over Colorado Rockies' Trevor Story to complete a double play in the fourth inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
San Francisco Giants’ Joe Panik throws over Colorado Rockies’ Trevor Story to complete a double play in the fourth inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)

Gray pitched in and out of trouble most of the night until Pillar’s home run leading off the seventh. Acquired from Toronto last week, Pillar has 10 RBIs over his last four games.

Mark Leiter (1996) and Ramon Ortiz (2005) also allowed home runs in 15 straight starts. The major league record is 20 set by Hall of Famer Bert Blyleven (1986-87).

TRAINER’S ROOM

San Francisco Giants pitcher Jeff Samardzija works against the Colorado Rockies during the first inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
San Francisco Giants pitcher Jeff Samardzija works against the Colorado Rockies during the first inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)

Rockies: 1B Daniel Murphy saw a hand specialist in Arizona, but the Rockies had yet to receive results. Murphy is out with a broken left index finger. . OF David Dahl (left side core injury) ran and played long toss in Arizona, although manager Bud Black said the team plans to take a cautious approach with Dahl’s rehab.

Giants: 3B Evan Longoria was rested. Pablo Sandoval started and went 0 for 4.

UP NEXT

Colorado Rockies pitcher Jon Gray works against the San Francisco Giants during the first inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
Colorado Rockies pitcher Jon Gray works against the San Francisco Giants during the first inning of a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)

Rockies RHP Chad Bettis (0-2, 11.88 ERA) attempts to get on track after allowing six runs in each of his previous two starts. The Giants counter with LHP Drew Pomeranz (0-1, 4.00).

___

San Francisco Giants pitcher Will Smith celebrates after the final out against the Colorado Rockies in a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
San Francisco Giants pitcher Will Smith celebrates after the final out against the Colorado Rockies in a baseball game Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
San Francisco Giants pitcher Will Smith, right, celebrates with catcher Buster Posey at the end of the team's baseball game against the Colorado Rockies Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)
San Francisco Giants pitcher Will Smith, right, celebrates with catcher Buster Posey at the end of the team’s baseball game against the Colorado Rockies Thursday, April 11, 2019, in San Francisco. (AP Photo/Ben Margot)