BALTIMORE — J.J. Hardy and Chris Davis each hit two of Baltimore’s six home runs, Hyun Soo Kim had a career-high four hits and the Orioles beat rookie Joe Musgrove and the skidding Houston Astros 13-5 on Thursday night.

Mark Trumbo and Manny Machado also homered to help the Orioles improve to 40-19 at home and climb into a second-place tie with Boston in the AL East. The 13 runs matched a season high, set June 1 against Boston.

Trumbo set the tone in the first inning with his major league-leading 35th home run, a three-run shot to left against Musgrove, who looked every bit like a 23-year-old rookie making his third major league start.

Alex Bregman and A.J. Reed homered for the Astros. They have lost five straight.

INDIANS 5, WHITE SOX 4: Cleveland Manager Terry Francona put up a pinch hitter in the middle of an at-bat and the strategy paid off when Tyler Naquin lofted a game-ending sacrifice fly in the ninth inning.

Abraham Almonte doubled off Jacob Turner (1-2) to begin the ninth. With Roberto Perez batting, a passed ball by Dioner Navarro moved Almonte to third.

Francona then sent Naquin to the plate with a 1-0 count. The rookie drove the first pitch he saw to center field, deep enough that Adam Eaton couldn’t prevent Almonte from scoring.

ROYALS 8, TWINS 1: Alex Gordon hit a grand slam, Dillon Gee pitched seven strong innings and Kansas City won at home.

The Royals have won five straight and 8 of 9 to move above .500 for the first time since July 22. Royals starting pitchers have a 1.61 ERA in the five-game winning streak.

NATIONAL LEAGUE

CUBS 9, BREWERS 6: Kris Bryant homered twice, doubled and drove in five runs while going 5 for 5, and Chicago overcame a career-high seven walks by Jake Arrieta to finish a four-game sweep at home.

Bryant tied Colorado’s Nolan Arenado for the NL lead with 30 home runs. The Cubs won for the 18th time in 21 games and improved the best record in the majors to 77-43.

Chicago led 5-0 when Arrieta (15-5) issued a pair of two-out walks in the fourth. Kirk Nieuwenhuis followed with a three-run homer.

Hernan Perez hit a solo homer in the sixth off Arrieta, who allowed four runs and three hits in 52/3 innings.

PHILLIES 5, DODGERS 4: Maikel Franco hit a go-ahead two-run home run in the seventh inning, Ryan Howard also homered and host Philadelphia avoided a three-game series sweep.

Justin Turner and Yasmani Grandal went deep for the Dodgers.

REDS 5, MARLINS 4: Ramon Cabrera hit a three-run homer, Dan Straily continued his second-half surge and host Cincinnati made it eight wins in 10 series since the All-Star break.

Billy Hamilton used aggressive baserunning to produce another run and Eugenio Suarez added an RBI double to give Cincinnati three straight wins over Miami after losing the opener of the four-game series.