SAN FRANCISCO (AP) — Yu Darvish and two relievers combined on a five-hitter and Cody Bellinger hit his 37th home run as the Los Angeles Dodgers won back-to-back games for the first time in nearly three weeks, beating the San Francisco Giants 4-1 on Wednesday night.

The win lowered the Dodgers' magic number to seven for clinching the NL West crown. Los Angeles secured at least a wild-card berth in the playoffs Tuesday night with a victory that ended its 11-game losing streak, the club's longest since moving to the West Coast in 1958.

Darvish, acquired from Texas at the July 31 trade deadline, was 2-3 with a 5.34 ERA in six previous starts with Los Angeles but was crisp in his first career outing against San Francisco. The All-Star right-hander pitched three-hit ball over seven innings, struck out five and allowed only three runners while facing one batter more than the minimum.

Brandon Morrow pitched the eighth and Walker Buehler allowed a run in the ninth before striking out Denard Span to end it.

Ten days after breaking Mike Piazza's franchise rookie record for home runs, Bellinger tied Al Rosen (1950) and Albert Pujols (2001) for fifth-most by a rookie in major league history with a two-run drive into McCovey Cove in the fifth inning.

Bellinger's home run on a 2-0 pitch from Matt Moore put the Dodgers up 4-0 and helped Darvish get his own season back on track after three consecutive losses.

It's the Dodgers' first series win in San Francisco since September 2014. They needed it, too, after a funk that included a stunning 16 losses in 17 games by the team with the best record in the majors (94-52).

Los Angeles gets an off day Thursday before opening a three-game series in Washington against the NL East-leading Nationals, who have the second-best record in the NL.

Moore (5-14) allowed four runs with five strikeouts and three walks.

The Dodgers made several big defensive plays. Darvish started a double play in the first inning, and Kike Hernandez sprinted in from left field to catch Buster Posey's fly ball and then threw on the run to first base to double up Jarrett Parker to end the seventh. Third baseman Justin Turner also made a sliding catch of Posey's popup behind the mound in the eighth.

___

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