Manny Machado of the San Diego Padres got his 2,000th career hit Monday night against the Arizona Diamondbacks with a sharp single off the glove of diving shortstop Geraldo Perdomo.

The milestone hit came off starter Zac Gallen leading off the fourth. Machado received a standing ovation from the crowd at Petco Park, where he’s been a fan favorite since joining the Padres in 2019.

The All-Star slugger singled to left field in the first for his 1,999th hit. In the eighth inning against reliever Kyle Backhus, he slugged his 15th home run of the season. He finished the night 3 for 5.

Gallen allowed an un- earned run, five hits and one walk with nine strikeouts over six innings as the Diamondbacks, who got a two-run homer from Josh Naylor, beat the Padres 6-3.

Machado became the fifth active player and 297th all time to reach the milestone. He is the 12th player to have 350 homers and 2,000 hits by his age-32 season.

Machado made his debut with Baltimore in 2012 and got 977 hits with the Orioles before being traded to the Dodgers on July 18, 2018. He had 73 hits with the Dodgers before signing as a free agent with the Padres on Feb. 21, 2019.

He has 951 hits with San Diego, which ranks fifth on the franchise list.

Giants 3, Phillies 1: Casey Schmitt drove home the go-ahead run on a groundball in the eighth inning and San Francisco beat visiting Philadelphia.

Orion Kerkering (5-4) hit Willy Adames with a pitch to start the Giants’ eighth before Matt Chapman’s single advanced Adames to third. Wilmer Flores was also plunked to load the bases for Schmitt.

Blue Jays 8, White Sox 4: Joey Loperfido homered and drove in three runs, and visiting Toronto beat Chicago for its ninth consecutive win.

Addison Barger and Nathan Lukes also connected as AL East-leading Toronto improved to 27-10 in its last 37 games.

At 53-38, the Blue Jays matched the franchise record for most victories before the All-Star break. It’s the longest win streak for the team since an 11-game run in August 2015.

José Berríos (5-3) pitched six innings of one-run ball, allowing two hits and two walks.

Mike Tauchman had three hits and two RBIs for the last-place White Sox, who won two of three at Toronto last month.

The Blue Jays opened an 8-1 lead when they scored five times in the sixth. Barger hit a two-run drive off Sean Burke (4-8) for his 12th homer, and Loperfido chopped a two-run single.

Guardians 7, Astros 5: José Ramírez and David Fry homered and Brayan Rocchio added a two-run double as Cleveland won at Houston to snap a 10-game losing streak.

The victory is the Guardians’ first since June 25.

The score was tied with two outs in the sixth and the Guardians had two on when Rocchio doubled to left field off Steven Okert to put them on top 6-4.

With two outs in the bottom of the inning, Victor Caratini homered off Matt Festa (2-2) on a shot to right field to get Houston within 1.

Fry connected with two outs in the ninth to give Cleveland an insurance run.

Taylor Trammell added a three-run homer and Isaac Paredes had a solo shot for the AL West-leading Astros,

Tigers 5, Rays 1: Keider Montero and three relievers combined on a five-hitter and Detroit defeated visiting Tampa Bay.

The Tigers (58-34) have won four straight games while only allowing four runs, improving to 24 games over .500 for the first time since 2013.

Montero (4-1) allowed one run and four hits and a walk in six innings while striking out four.

Tyler Holton, Brenan Hanifee and Will Vest each pitched a scoreless inning to complete the win.

Shane Baz (8-4) gave up three runs and seven hits with two walks and seven strikeouts in six innings for the Rays, who have lost seven of their last 10 games. Baz entered the game with a 5-0 record in his last eight starts.

The Tigers took the lead in the second on Javier Báez’s two-run homer.

Colt Keith and Zach McKinstry homered against Paul Gervase in the eighth.

Red Sox 9, Rockies 4: Roman Anthony hit a two-run homer among his three hits, Ceddanne Rafaela homered for the third straight game and Boston topped Colorado at Fenway Park.

Boston rookie Richard Fitts (1-3) allowed five hits, two earned runs and struck out six over 5 2/3 innings to notch his first MLB victory.

Romy Gonzalez added a solo homer, and Abraham Toro had a two-run double to help Boston post its fourth straight win and seventh in nine games.

Rockies starter Austin Gomber (0-2) exited after 4 2/3 innings, yielding five runs and seven hits.

Marlins 5, Reds 1: Janson Junk allowed one hit in six innings and Agustín Ramírez homered to lead Miami in a road win over Cincinnati.

Spencer Steer had a leadoff single in the fifth for the lone hit off Junk.

Lake Bachar retired eight batters in relief before exiting with two on in the ninth. Anthony Bender struck out Austin Hays on three pitches to earn his second save.

Junk (3-1) had gone 89 innings without issuing a walk dating to last season until Hays drew one leading off the second. Hays went to second on a passed ball and third on a wild pitch before Gavin Lux drew a second consecutive free pass.

Tyler Stephenson’s sacrifice fly scored Hays for an unearned run and a 1-0 Reds lead without a hit.

Xavier Edwards doubled off Cincinnati starter Brady Singer with one out in the fifth and scored on Ramírez’s double to tie it. Liam Hicks singled in Ramírez to give Miami a 2-1 lead.

Royals 9, Pirates 3: Bobby Witt Jr. and Salvador Perez hit two of Kansas City’s four home runs to back a strong start by rookie Noah Cameron in a home win over Pittsburgh.

Cameron (3-4) struck out seven in a season-high seven innings. The left-hander allowed three hits, a walk, and two runs — on Tommy Pham’s two-run shot in the third.

Witt hit his 13th homer, a two-run shot the opposite way to right-center field off reliever Chase Shugart to give the Royals a 6-2 lead in the fourth. He added a sacrifice fly in the sixth.

Perez hit his 11th homer, a solo shot to left in the fifth for a five-run advantage.

Vinnie Pasquantino and Nick Loftin also went deep for the Royals.

Pirates starter Andrew Heaney (4-8) allowed four runs in three innings.