PHOENIX — Five home runs, 18 hits, 20 runs.

The Arizona Diamondbacks have never had a better offensive night than they did Saturday against the San Diego Padres.

David Peralta drove in three runs and matched his career best with five hits and the Diamondbacks set a single-game franchise scoring record with a 20-5 rout of the Padres.

"It wasn't just a good night for me," Peralta said. "It was a good night for everybody."

Wil Myers became the third Padres player to homer three times in a game, but San Diego was blown out in its 16th loss in 21 games.

"This day was painful, there is no doubt about it," Padres manager Andy Green said. "This day was painful for fans, painful for players, for us. But you have to look at it like tomorrow you have a chance to split the series against a first-place club. It is one loss. It is a painful one. We will remember it, but we will also move on."

Paul Goldschmidt, Steven Souza Jr., Alex Avila, Nick Ahmed and Ketel Marte homered for the Diamondbacks in breaking the team scoring record set in an 18-7 victory over the Los Angeles Dodgers on May 17, 2014.

Goldschmidt, Ahmed and Avila also each had three RBIs.

"I don't even know where to start, to tell you the truth," Arizona manager Torey Lovullo said. "You set a franchise record for runs scored in a game, you know that you've done something pretty special."

The romp kept the Diamondbacks a game ahead of the second-place Dodgers in the NL West.

Arizona jumped on Tyson Ross for eight runs in the first two innings and was up 15-4 after four, scoring at least three runs in four consecutive innings for the first time in franchise history.

Ross (5-7) lasted just two innings, giving up eight runs and seven hits.

"Days like today happen," he said. "It was a rough one for me out there."

Ross has allowed 15 runs in seven innings in his last two outings.

Goldschmidt's three-run shot off reliever Kazuhisa Makita was the slugger's 20th homer of the season, the sixth time in his career he has homered 20 times in a season. Souza's homer off Ross was his first of the season. Avila, just off the disabled list, had two RBI singles to go with his fourth homer of the season.

Despite the huge early lead, Robbie Ray did not last long enough to get the victory. In his third start since coming off the disabled list, Ray allowed four runs, including three homers, and four hits, walking four in 4 1/3 innings. He left after throwing 97 pitches.

Ray said it was "very frustrating" to not get through the fifth inning despite such a big lead.

Lovullo said he pulled Ray because of the high pitch count, even though it deprived the left-hander of a victory.

"I know he was frustrated. He was growling at me when I took him out of the game, so I know he wanted the win," Lovullo said. "That's great, but I have to separate some things at times and his health is obviously the most important thing."

Randall Delgado (1-0), in his first appearance of the season, allowed one hit in 1 1/3 innings to get the victory. Delgado had spent the season on the disabled list with a strained left oblique before being activated Friday.

Myers had the second three-homer game by a Padre this season. Christian Villanueva did it against Colorado on April 2. Jose Pirela also homered off Ray on Saturday.

The Padres led 2-0 two batters into the game after Manuel Margot's leadoff walk and Myers' home run. But the Diamondbacks batted around to score five in their half of the first.

The Diamondbacks had dropped six of seven before beating San Diego twice in a row. Arizona is 3-6 on a homestand that ends Sunday.

TRAINER'S ROOM

Padres: LHP Jose Castillo was placed on the 10-day DL, retroactive to Friday, with a right hamstring strain. RHP Kazuhisa Makita was recalled from Triple-A El Paso.

Diamondbacks: Avila (strained right hamstring) was activated from the 10-day DL and RHP Silvino Bracho was optioned to Triple-A Reno.

UP NEXT

Zack Greinke (9-5, 3.36 ERA), 4-0 with a 1.73 ERA in his last four starts, takes the mound for Arizona and LHP Clayton Richard (7-8, 4.46) goes for the Padres on Sunday in the finale of the Diamondbacks' 10-game homestand.