Darren Yamashita-USA TODAY Sports

Patrick Bailey crushed a walk-off, three-run homer with no outs in the bottom of the ninth inning Friday night, producing the only scoring of the San Francisco Giants' 3-0 victory over the Pittsburgh Pirates.

After Camilo Doval (2-0) had pitched out of a bases-loaded jam in the top of the inning, Pirates closer David Bednar (1-2) walked Michael Conforto and served up a single to Matt Chapman to start off the bottom of the inning.

A wild pitch advanced the baserunners, but rather than intentionally walk Bailey to load the bases and create a potential forceout at the plate, Bednar grooved a 1-1 fastball that the San Francisco catcher drilled over the right field wall for his third homer of the season.

The Pirates threatened in the top of the ninth against Doval, loading the bases on singles by Oneil Cruz and Michael Taylor and a one-out walk by Andrew McCutchen. Doval turned a comebacker from Bryan Reynolds into a 1-2-3 double play to preserve the tie.

The Pirates were denied the game's first run earlier because of a rarely seen rule involving a hit batter.

Hitting with the bases loaded and a 2-2 count in the seventh, the Pirates' Reynolds was hit in the foot by a breaking pitch from Ryan Walker. However, because Reynolds swung and missed at the ball in the dirt, the ball was ruled dead upon making contact with the batter and an inning-ending strikeout was recorded as the ball rolled away and Taylor scampered home.

Walker had taken over for Giants starter Kyle Harrison, who shut out Pittsburgh on five hits over the first six innings. He struck out seven without issuing a walk.

Walker was matched pitch for pitch by the Pirates' Quinn Priester, who allowed just three singles in his six shutout innings. He walked one and fanned six.

Bailey's homer was the only extra-base hit for the Giants, who won for the third time in their past four games despite getting out-hit 8-6.

Ke'Bryan Hayes, who made a key defensive play in the eighth inning to prevent a Giants run, and Taylor had two hits each for the Pirates, who lost their third straight.

The contest was the opener of a three-game series.

More must-reads:

TODAY'S BEST
Mavericks provide notable status update on star rookie ahead of Game 5
Watch: Benches clear after Giants buzz Bryce Harper
Wizards make decision on their new head coach
Veteran sportscaster gives valuable insight into Caitlin Clark's WNBA debut
Patriots QB Jacoby Brissett addresses 'elephant in the room'
Iga Swiatek, Naomi Osaka have opposite reactions to crowd following epic French Open match
AEW owner stays quiet on potential interest in top WWE star
Donovan Mitchell's influence on Cavaliers listed among 'most powerful' in the NBA
Clippers 'determined' to keep these two star free agents
AEW sustains another major injury blow after Double or Nothing
Celtics HC Joe Mazzulla offers update on Kristaps Porzingis ahead of NBA Finals
Bengals HC Zac Taylor addresses holdouts from pair of star receivers
Charges against Scottie Scheffler dropped
Yankees icon respects Juan Soto holding out for free agency
Kyrie Irving praises Karl-Anthony Towns for overcoming 'unfair criticism' in Game 4
Cardinals star addresses struggles: 'I don't know what the answers are'
Manchester United star taking break from social media after challenging season
Jets HC explains how former Pro Bowl RB could help team
What Anthony Edwards told Cowboys star after Game 4 win
Bronny James' agent provides huge update on client's future

Want more MLB news?

Join the hundreds of thousands of fans who start their day with Yardbarker's Morning Bark, the best newsletter in sports.