LOS ANGELES — Exhausting and then exhilarating for the Los Angeles Dodgers.

Max Muncy's home run leading off the bottom of the 18th inning finally ended the longest World Series game in history early Saturday and gave Los Angeles a 3-2 victory over the Boston Red Sox that drew the Dodgers to 2-1 in the best-of-seven Series.

While the Dodgers mobbed Muncy at home plate, the Red Sox will rue one that got away.

They were oh-so-close in the 13th to taking a huge 3-0 lead. But second baseman Ian Kinsler's wide throw on a two-out grounder by Yasiel Puig let Los Angeles score the tying run in a game that lasted 7 hours, 20 minutes.

Muncy later homered to left-center off Nathan Eovaldi, jolting the remaining fans to their feet at 12:30 a.m. A grinning Muncy tossed his helmet in the air as he headed for third.

Recalling Kirk Gibson's winning pinch-hit homer in Game 1 of the 1988 World Series, Muncy came within feet of ending it in the bottom of the 15th. But his shot to right sailed just foul and he ended up striking out.

The battle of attrition had a bit of everything, including 18 pitchers and 27 position players.

Long after rookie Walker Buehler dazzled over seven shutout innings for the Dodgers, things got interesting.

The Red Sox tied it 1-all in the eighth and took a 2-1 lead in the 13th.

The Dodgers answered with the tying run in the bottom of the inning.

After Dodgers center fielder Cody Bellinger made the throw of his life in the 10th, both teams scored on bizarre errors in the 13th.

Boston manager Alex Cora used starter David Price in relief, rotated his outfielders in the middle of innings and even put catcher Christian Vazquez at first base for the first time in his big league career.

Out of position players, Dodgers manager Dave Roberts called on ace Clayton Kershaw to pinch-hit in the 17th. He flied out.

The stadium organist was busy, too, launching into "Take Me Out to the Ball Game" in the 14th inning — a second version of the seventh-inning stretch. Not many had left by then.

The crowd cheered when the stadium clock reached midnight.

Game 4 is Saturday at Dodger Stadium. Eovaldi was scheduled to start for the Red Sox, but he threw 97 pitches in relief as one of nine pitchers they used. Left-hander Rich Hill starts for the Dodgers.

The Red Sox had a wild 13th, with a walk, a steal, an infield hit and an error before taking a 2-1 lead.

Brock Holt drew a leadoff walk and stole second. Pinch-hitter Eduardo Nunez got flipped on his back by catcher Austin Barnes as he chased Scott Alexander's wild pitch.

Nunez then reached on a nubber to the right side and Alexander botched the throw to first, allowing Holt to score. Nunez got knocked on his back again in the play at first, but stayed in the game since the Boston had no one left on its bench.

The Dodgers tied it 2-all in the bottom of the 13th. Muncy drew a leadoff walk and tagged up when Nunez tumbled into the third base stands after catching Cody Bellinger's pop foul. Muncy scored when Kinsler botched the throw to first on Yasiel Puig's infield single.

Boston's Jackie Bradley Jr. tied it 1-all with a homer off closer Kenley Jansen in the eighth.

The Dodgers led 1-0 on Joc Pederson's two-out homer in the third.

Both teams squandered numerous chances. The Red Sox stranded runners in the 10th and 11th. The Dodgers left runners on in every inning from the fifth to the 11th.

Boston had runners at the corners in the 10th. Pedro Baez walked J.D. Martinez with one out and took third on Holt's single to center.

Bellinger started a sensational, inning-ending double play from center field, catching Nunez's pinch-hit fly and then firing to catcher Austin Barnes a few feet up the third-base line. Barnes made the tag as Kinsler came barreling past and both players tumbled to the dirt.

The game began in 78-degree heat — 31 degrees warmer than at Fenway Park for the first two games.

Buehler stymied the Red Sox through seven scoreless innings. The right-hander retired his final 14 batters before leaving after 108 pitches. He allowed two hits, struck out seven and didn't walk anyone.

Boston starter Rick Porcello gave up one run and three hits in 4 2/3 innings, struck out five and walked one.