Hyun-Jin Ryu stretched his road scoreless streak to 26 innings this season and 28 in all, and the Los Angeles Dodgers beat the San Francisco Giants 2-1 on Thursday to avoid a sweep.

Ryu (3-1) struck out three and walked one on a season-high 112 pitches in seven innings, helping his club move into a tie with the Giants atop the NL West at 10-6. The Giants played their seventh straight one-run game, their most since eight in a row in 1910, according to STATS.

Yasiel Puig returned to the Dodgers' starting lineup and went 1 for 4 with a strikeout. He dropped a routine fly ball in right early on but recovered to throw out Brandon Belt at second. He then made a nice over-the-head catch on the next batter and a running grab in shallow center in the eighth with a runner on second. He said the ball hit his thumb area on the play he missed, and he didn't close his glove quickly enough.

Tim Federowicz hit an RBI single in the second to put the Dodgers ahead, and Adrian Gonzalez singled in a run in the fifth to chase Madison Bumgarner.

Gonzalez extended his hitting streak to 12 games, adding an eighth-inning double.

Former Giants closer Brian Wilson gave up a leadoff double to Ehire Adrianza but escaped the inning unscathed. Kenley Jansen gave up a two-out RBI single to Adrianza before finishing for his fifth save.

Ryu had surrendered a career-high eight runs in a career-short two innings against the Giants in the Dodgers' home opener April 4.

"Kind of what we needed today for him to go seven and go back out there for the seventh," manager Don Mattingly said. "It worked out."

With his bushy beard freshly shorn, Bumgarner (2-1) had a three-start winning streak against the Dodgers snapped with just his second loss in the past seven outings against Los Angeles. The left-hander allowed two runs, six hits and three walks with six strikeouts in 4 1-3 innings but threw 99 pitches.

"Not a whole lot went in our favor. I'm not trying to change anything," Bumgarner said. "That was some of the best stuff I've had so far. It's been tough getting deep into games right now."

Los Angeles played without shortstop Hanley Ramirez, a day after he was hit by a pitch on the top of his left hand. The Dodgers said there is no fracture, and Ramirez said he had iced the hand eight times and planned to play Friday against Arizona to begin a 10-game homestand.