SAN FRANCISCO (AP) — Alex Wood pitched seven strong innings of three-hit ball, and the San Francisco Giants beat the St. Louis Cardinals 5-2 on Wednesday night.

Darin Ruf homered for San Francisco. Mike Yastrzemski and Donovan Solano both doubled in runs as the Giants avoided a three-game sweep.

San Francisco had lost six of nine but still owns the best record in the majors at 54-32 with three games left before the All-Star break.

Dylan Carson had two hits for St. Louis.

Wood (8-3) set down 19 of 22 after allowing Nolan Arenado’s two-out RBI double in the first. The Giants lefty had six strikeouts and two walks and won for the first time in four career starts against the Cardinals.

Tyler Rogers retired three batters. Jake McGee pitched the ninth for his 17th save.

St. Louis starter Johan Oviedo (0-5) couldn’t overcome a shaky start. Eight of Oviedo’s first nine pitches were balls and the Giants first run came when the right-hander hit Jason Vosler with the bases loaded.

Oviedo, who is winless in his first 16 career starts, allowed two runs and three hits in four innings.

WILD PITCH

Cardinals reliever John Gant nearly threw a ball over the protective netting behind home plate after a late timeout was granted by home plate umpire Roberto Ortiz. Wood was at the plate and stepped out of the batters box just as Gant began his delivery, causing the St. Louis pitcher to sail the ball near the top of the netting.

GIANTS MOURN PASSING OF EXEC

A moment of silence was held before the game for Giants Director of Dominican Republic Operations Pablo Peguero, who passed away Wednesday morning at his home in Santo Domingo. The 68-year-old Peguero was in his 18th season with the club. He previously worked with the Dodgers and was general manager of the Dominican Republic Olympic Team for the 1999 PanAm Games.

TRAINER’S ROOM

Cardinals: RHP Carlos Martínez was placed on the 10-day Injured List because of what manager Mike Shildt termed a torn ligament in Martínez’s right thumb, an injury the pitcher suffered while batting during Sunday’s loss in Colorado. “It’s not great,” Shildt said. “It’s certainly going to be something that’s going to impact him for some time. I don’t expect him back in our rotation in the very near future.” OF Lars Nootbaar was recalled from Triple-A Memphis.

Giants: Buster Posey sat out his third consecutive game with a bruised left thumb.

UP NEXT

Cardinals: Following an off day, LHP Wade LeBlanc (0-1, 4.24 ERA) faces the Cubs at Wrigley Field on Friday afternoon. LeBlanc is making his first start against Chicago since 2013 when he was with the Marlins.

Giants: Manager Gabe Kapler has not named a starter for Friday’s game against Washington.

© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.