Dodgers’ ace Clayton Kershaw got the last two outs of the game with the go-ahead run on-base in the bottom of the ninth inning, and Los Angeles rallied to beat the Washington Nationals, 4-3, in the decisive Game 5 of the National League Division Series on Thursday night.

With the win, the Dodgers advanced to play the Cubs in the NLCS, which begins on Saturday in Chicago.

Down 1-0 thanks to a masterful start by Washington’s Max Scherzer, Los Angeles rallied for four runs in the seventh inning. Joc Pederson led off the inning with a game-tying homer, causing Nationals’ manager Dusty Baker to pull Scherzer. Things went badly for Washington after that.

After a walk to Yasmani Grandal, a single by Howie Kendrick and a failed bunt attempt by Charlie Culberson, pinch-hitter Carlos Ruiz drilled a one-out single to left that scored the go-ahead run for the Dodgers. Justin Turner followed with a two-out triple two batters later that gave L.A. a 4-1 edge.

Chris Heisey's pinch-hit, two-run homer in the bottom of the seventh gave the Nats hope, but Dodgers' closer Kenley Jansen struck out Anthony Rendon with the bases loaded to squash the rally.

Jansen pitched the eighth inning and into the ninth, but he walked both Bryce Harper and Jayson Werth with one out, forcing L.A. manager Dave Roberts to go to Kershaw. The staff ace got Daniel Murphy to pop out, and struck out Wilmer Difo to end -- and save -- the game.

Julio Urias got the win for Dodgers; Marc Rzepczynski took the loss for Washington.

2016 NLDS Recap: Dodgers beat Nationals, 3-2
Game 1: Los Angeles 4, Washington 3
Game 2: Washington 5, Los Angeles 2
Game 3: Washington 8, Los Angeles 3
Game 4: Los Angeles 6, Washington 5
Game 5: Los Angeles 4, Washington 3
Home team in bold