LOS ANGELES — Didi Gregorius hit a grand slam off All-Star Hyun-Jin Ryu and added a solo shot to help the Yankees set a club record for homers in a month, and New York routed the Los Angeles Dodgers 10-2 Friday night in a matchup of the two teams with the best records in baseball.

Aaron Judge, Gary Sánchez and Gleyber Torres also homered as the Yankees ended a four-game skid. They have a major league-leading 57 homers in August, their most in any month.

Starting on five days' rest, James Paxton (10-6) allowed two runs and five hits in 6 2/3 innings to win his fifth straight start. He struck out 11 — one off his season high — and walked none.

The teams' first meeting in three years had a post-season feel, even though neither club looked the part. The Yankees' pinstripes and Dodgers' blue and white uniforms were cast aside on Players' Weekend. The Yankees wore all black and the Dodgers donned all white with player-chosen nicknames on the back.

The sellout crowd of 53,775 saw a potential October preview between two franchises that used to battle in New York before the Dodgers moved West before the 1958 season. They've met 11 times in the World Series, with the Yankees winning eight titles.

After scoring just nine runs in dropping three straight at Oakland, the Yankees (84-46) cranked up their offence early. They led 2-0 in the third on the homers by Judge, who has gone deep to left field twice in four days after not pulling a homer previously this season, and Sánchez.

Ryu (12-4) opened the fifth by allowing consecutive singles to DJ LeMahieu and Judge. After Torres grounded out, Ryu intentionally walked Sánchez to load the bases.

That set up Gregorius, who launched a 90-mph fastball into the right field pavilion for his fifth career grand slam. Gio Urshela doubled to chase Ryu before Brett Gardner's RBI double off Adam Kolarek made it 7-1.

Ryu struggled through his second straight sub-par outing. The left-hander came in with baseball's best ERA of 1.64, but he gave up seven runs and nine hits in 4 1/3 innings, his shortest outing since June 28. He struck out seven and walked one.

Ryu was coming off a 4-3 loss at Atlanta in which he allowed all four Braves' runs in 5 2/3 innings.

Torres homered with two outs off Yimi Garcia in the sixth for an 8-1 lead.

Gregorius homered in the ninth.

The Dodgers' run of three straight wins and five victories in a row at home, including consecutive walk-off wins, came to an abrupt halt.

The Dodgers' runs came on A.J. Pollock's RBI single in the third and Kiké Hernández's RBI double in the seventh.

TRAINER'S ROOM

Yankees: 1B Luke Voit (sports hernia) was 0 for 3 with a walk and a strikeout in his first rehab game with Triple-A Scranton/Wilkes-Barre.

Dodgers: RHP Ross Stripling (right biceps tendinitis) tossed 35 pitches in a bullpen session.

QUICKEST TO 100

Sánchez became the fastest catcher in major league history to 100 homers in his 355th career game. He surpassed Mike Piazza, who did it in 422 games with the Dodgers.

UP NEXT

Yankees: LHP CC Sabathia (5-7, 5.01 ERA) starts on five days' rest. He's failed to last at least five innings four times this season, including in three straight games for just the second time in his career.

Dodgers: RHP Tony Gonsolin (1-1, 3.00) makes his fourth career start against the Yankees.

___

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports