SAN FRANCISCO — Matt Cain pitched six scoreless innings to beat the Dodgers for the first time in nearly four years, and the San Francisco Giants snapped a four-game losing streak with a 2-1 win against Los Angeles on Monday night.

Joe Panik hit a second-inning sacrifice fly off Hyun-Jin Ryu (0-4) in just the Giants' second victory in their last eight games. Hunter Pence added a key RBI single for insurance in the seventh.

Top prospect Christian Arroyo was promoted by the Giants to be the new regular third baseman and he went 0 for 4 with three groundouts to second and a strikeout.

Cain (2-0) allowed two hits, struck out three and walked one and has been a steady presence in San Francisco's rotation so far. He beat the Dodgers for the first time since May 5, 2013, also at AT&T Park. The right-hander, a victim of low run support for years and with injury bad luck the past few seasons, had been 0-3 with a 4.86 ERA in six starts since.

After the game, manager Bruce Bochy said that one of Cain's hamstrings tightened and he'll have it checked.

Mark Melancon, San Francisco's fourth reliever, finished for his fourth save in five chances. Justin Turner extended his hitting streak to 10 games with a one-out single in the ninth.

Ryu has lost his last six starts since Sept. 12, 2014, still seeking his first victory since Aug. 31, '14.

Pinch-hitter Chris Taylor's groundout in the seventh got the Dodgers on the board, but they lost their sixth straight in San Francisco after going 2-8 at AT&T Park last year.

Eduardo Nunez moved from third to left field for San Francisco with the addition of Arroyo.

ROMO'S RETURN

Sergio Romo was downright giddy to be back at AT&T Park, where he got his big league start spending his first nine seasons with the Giants — and helping them to three World Series championships.

"For me, it's a homecoming, it really is," he said, sitting in the Dodgers dugout before the game, then adding of the rivalry, "It's on, it's on, it's on."

He pitched the eighth for L.A. to some chants of "Beat Ro-mo!"

Romo highlights were shown — complete with his entry music "El Mechon" — after the first inning and he smiled, popped out of the dugout and tipped his cap every which way, even sending an air hug to the opposite dugout and his old teammates and coaches.

TRAINER'S ROOM

Dodgers: LHP Rich Hill, on the disabled list nursing a blister on his left middle finger, threw 30 pitches with a bandage on the finger and will throw again in two days at 25 pitches with no bandage. ... RHP Kenta Maeda's next start will be pushed from Thursday to Friday.

Giants: LHP Madison Bumgarner, out indefinitely with bruised ribs and a sprained pitching shoulder, shared details of his dirt bike accident last Thursday in Colorado. He had a protective sling over his pitching arm as he sat in the dugout and he will likely wear it for another week to 10 days, athletic trainer Dave Groeschner said. Bumgarner was scheduled to have another MRI exam later in the evening and be checked by Dr. Ken Akizuki. ... OF Drew Stubbs also was called up from Sacramento and made his Giants debut in CF for the injured Denard Span, who needs another three or four days following a mild right shoulder sprain that forced him out of Saturday's game at Colorado. Span can be used as a pinch runner, but isn't yet ready to throw.

UP NEXT

Dodgers: LHP Clayton Kershaw (3-1, 2.54 ERA), who has limited opponents to a .184 batting average so far, is 18-8 with a 1.61 ERA in 36 starts and 35 appearances vs. the Giants but won't line up against Bumgarner as has happened so often of late.

Giants: LHP Ty Blach makes his first start of the season pitching in Bumgarner's rotation slot. He has a 4.76 ERA over seven relief outings this year.

___

More AP baseball: https://apnews.com/tag/MLBbaseball