LOS ANGELES — Justin Turner homered twice and AJ Pollock, Will Smith and Edwin Ríos also went deep as the Los Angeles Dodgers rallied to beat the Angels 9-5 on Friday to open the first-ever season-closing Freeway Series.

The loss mathematically eliminated the Angels from postseason contention in Joe Maddon's first season as manager, and gave the final AL playoff spot to the Houston Astros.

The Angels' longshot hopes had rested on sweeping the Dodgers in the Freeway Series and Houston losing its final three games. The Astros kept the Angels' optimism flickering when they dropped a 5-4 decision at Texas in 10 innings. The Angels led 5-3 at the time.

"This is one time I'm yearning for 162 (games), because they had a real solid chance of turning this around and pushing it in the right direction," Maddon said. "We gave it a nice run. Texas really helped us out a lot. We had a nice thing going on, we grabbed the lead here, we just cannot hold on to it."

Turner hit a solo shot leading off the fifth and Max Muncy singled to chase Andrew Heaney. Smith followed with a two-run drive off Matt Andriese (2-4) that gave the Dodgers a 6-5 lead. It was the major league-leading 112th homer of the season for the team with the best record in baseball.

Dodgers manager Dave Roberts cited the power of everyone in his lineup.

"Especially this last 14, 15 days, we've really taken our walks and been grinding," he said. "I really like how we're going about it."

Corey Seager's diving stop against Mike Trout at short saved the potential tying run for the third out in the seventh. Trout earlier homered off Clayton Kershaw, just his third career hit off the left-hander. Trout is 3 for 18 against him.

"Maybe I was fortunate in the past," Kershaw said.

The Dodgers' victory allowed the Astros to finish second in the AL West and qualify for the 16-team postseason. Los Angeles lost to Houston in the 2017 World Series; the Astros' sign-stealing scandal was later exposed.

The Angels got homers from Trout, Justin Upton and Jared Walsh, but blew three leads in the game. Trout's three-run drive — his 17th of the season — gave them a 3-1 lead in the third. Trout's runs were unearned after Seager's fielding error. Seager was charged with a second error after dropping a foul ball by Shohei Otani in the ninth.

"I don't think anybody in our clubhouse was ever going to give up on the season, was ever going to give up on this team," Heaney said, "and that's all you can ask."

Turner's two-out solo shot landed in the Dodgers' bullpen in right, pulling them to 3-2 in the third. Pollock homered leading off the fourth to leave them trailing 4-3.

Walsh's homer led off the fifth, extending the Angels' lead to 5-3.

Pinch-hitter Joc Pederson had a RBI single with two outs in the seventh. Ríos homered with two outs in the eighth to make it 9-5. That snapped Mike Mayers' streak of 14 straight scoreless outings.

Brusdar Graterol (1-2) got the win with one inning of relief, allowing one run and one hit.

Kershaw tuned up for next week's NL wild-card series with a so-so performance. He gave up four runs — one earned — and eight hits on 78 pitches over four innings. He struck out three and walked none. The three-time NL Cy Young Award winner ended the regular season with 6-2 record and a 2.16 ERA.

"It was a bad night," Kershaw said. "Nothing was great, but thankful it's now and not later. I'm probably just not going to think about this one that much."

TRAINER'S ROOM

Angels: 2B Luis Rengifo was replaced by a pinch runner after singling leading off the seventh. Earlier, he took a foul tip off the protector on his lower leg and appeared to be in pain. The Angels had no update on him after the game.

Dodgers: Muncy was replaced in the seventh after getting stung on the wrist during a checked swing.

FIRE ALARM

The game was delayed briefly with one out in the seventh when a fire alarm went off in the outfield pavilions, causing white lights to flash — a distraction to hitters — and a siren to wail. The players and umpires stood around looking at each other until it was shut off.

TURNER WINS CAMPANELLA AWARD

Turner won the Roy Campanella Award for the third time, the first Dodger to do so.

The Dodgers uniformed personnel vote for the player who best exemplifies the spirit and leadership of the late Hall of Fame catcher, a three-time NL MVP who died in 1993. Campanella's daughter Joni Roan will present the award via video on Saturday night.

Turner has been a fixture in the Los Angeles community since joining the team seven years ago. From mid-March through June, he and his wife selected a restaurant and ordered an estimated 900,000 meals to be delivered to the Dream Center, which fed over 12,000 people at the height of the coronavirus pandemic. Turner visits hospital patients and supports homeless veterans through a golf tournament.

UP NEXT

Angels: RHP Dylan Bundy (6-3, 2.39 ERA) starts the middle game of the series. He's allowed three or fewer earned runs in nine of 11 starts this season.

Dodgers: RHP Tony Gonsolin (1-2, 1.77) makes his first career start against the Angels. He's 2-0 in five games (three starts) against AL teams with a 2.37 ERA.