MLB: San Francisco Giants at Boston Red Sox

Red Sox starter Eduardo Rodriguez delivers a pitch Thursday’s win over the Giants, his 18th of the season.

BOSTON — The lone constant in the Red Sox starting rotation this season delivered yet another strong performance Thursday afternoon.

Eduardo Rodriguez was as brilliant against the San Francisco Giants as the cool sunshine that bathed Fenway Park. The left-hander continued his blitz toward 200 innings of work and maintained hopes of reaching 20 victories by earning his 18th win courtesy of a 5-4 decision over the Giants.

The Giants were powerless to stop Rodriguez. An unearned run in the top of the first inning was all they could manage against Boston’s de facto ace, as Rodriguez buzzed his way through six frames and turned things over to the bullpen.

The Red Sox’ relief corps flirted with a meltdown and ultimately helped the club avoid a sweep in this series.

Boston was in cruise control with a 5-1 lead until Marcus Walden issued a two-out walk in the eighth.

Mike Yastrzemski rapped a pinch-hit single to left and Kevin Pillar grounded a two-run double inside the bag at third, cutting San Francisco’s deficit in half. Matt Barnes was summoned and the bases were loaded when he buried a curveball in the dirt to strike out Stephen Vogt.

There was more trouble to come in the ninth, as Brandon Workman loaded the bases with nobody out and threatened to suffer the 26th blown save recorded by the Red Sox this season.

Strikeouts by Brandon Crawford and Yastrzemski nearly pulled Workman out of the jam, but Pillar drew a walk to make it a one-run game. Evan Longoria swung over the top of a 3-2 curveball to end it, a brassy pitch selection by Workman with the tying run just one ball away.

Rodriguez allowed just a pair of singles and struck out 10, his fourth time reaching double digits this season. San Francisco swung and missed 21 times on his 107 pitches, 14 of those coming on his four-seam fastball.

Rodriguez didn’t allow a runner to reach scoring position after the first, controlling the Giants with what has become an expected display of power and precision.

Mauricio Dubon’s leadoff single to left and a Pillar grounder under the glove of Marco Hernandez at second gave San Francisco runners at the corners in the first. Longoria lifted a sacrifice fly to left and the Giants had a quick 1-0 lead. Buster Posey struck out swinging to end the inning and Rodriguez wasn’t seriously threatened again.

The Red Sox took the lead before Rodriguez threw his next pitch. Run-scoring singles by Rafael Devers and Xander Bogaerts staked Boston to a 2-1 advantage in the first, as four straight hitters reached safely against Madison Bumgarner. Devers served a soft liner into right and Bogaerts went sharply back through the middle.

The top of the order did the damage again in the second, staging a two-out rally to make it a 5-1 game. Four consecutive singles by Andrew Benintendi, Christian Vazquez, Devers and Bogaerts were enough to condemn Bumgarner to defeat.

Devers looped a run-scoring liner to center and Bogaerts sent a two-run flare into shallow right.