PHOENIX (AP) The Arizona Diamondbacks figured Yasmany Tomas for more of a gap-to-gap type of hitter when they signed him. But in Tomas' second major league season, he's found a home run swing.

Tomas hit his first career grand slam, and the Arizona Diamondbacks came back from a three-run deficit after squandering a five-run lead to beat the Colorado Rockies 12-9 on Monday night.

Tomas had four hits and five RBIs, four on an opposite-field slam to right in the sixth inning off Jordan Lyles. Brandon Drury also had four hits, including a solo homer in the seventh for Arizona.

''In (batting practice) he exhibits more power than anybody. He hits it farther,'' Diamondbacks manager Chip Hale said. ''Most of the year, he's hitting balls way up on that batter's eye. He has it in him. I didn't think it would come this quickly.''

Lyles (4-5) got the first two outs of the sixth with the Rockies ahead 9-6. Then he gave up consecutive singles to Drury, Paul Goldschmidt and Welington Castillo before Tomas connected.

Tomas matched his career high for hits in a game. His 29 home runs lead the Diamondbacks this season.

Mitch Haniger's first major league home run also came in the Diamondbacks seventh. Randall Delgado (4-1) was credited with the win despite retiring only one of the four batters he faced in the sixth, and Daniel Hudson earned his third save.

''Just trying to keep it simple and swing at good pitches,'' said Haniger, who struck out his first three times up. ''That was a good comeback. We got off to a good lead early and then lost it, but it was a good finish. It shows a lot about the guys in this clubhouse.''

Arizona, with 16 hits on Monday, has 10 or more in 12 consecutive games against the Rockies. That makes the Diamondbacks the first NL team since the 1932 Brooklyn Dodgers to have a 12-game streak of 10-plus hits against a single opponent in one season.

Daniel Descalso homered and drove in three runs, and Carlos Gonzalez doubled three times and added three RBIs for the Rockies. Colorado's 15 hits included four for Gonzalez and three for Nolan Arenado and Charlie Blackmon.

Arenado's two-run single in the sixth gave Colorado a 9-6 lead after Descalso opened the inning with a solo shot. The Rockies trailed 5-0 going into the fourth inning.

''Charlie and DJ (LeMahieu) have been getting on base and doing their thing most of the year if not all year,'' Rockies manager Walt Weiss said. ''When they do that, Nolan and CarGo are swinging the bats and we will score some runs like we did tonight. But you've got to keep them from scoring, too.''

Diamondbacks starter Shelby Miller helped himself with the bat, doubling and scoring on a sacrifice that resulted in pitcher Tyler Anderson's throwing error in the fourth. But the Rockies drew even at 6 in the fifth on Gonzalez's two-out, two-run double followed by a soft single by Raimel Tapia that scored Gonzalez.

That was all for Miller, who started strong by getting the first nine outs in order but ended up allowing six runs and nine hits.

''There was a lot of high fastballs that most guys can't get on top of, that they were getting on top of and hitting very hard,'' Hale said. ''It's tough to give up the runs, but it was good to see his arm was working well.''

Anderson yielded five earned runs and nine hits in 4 1/3 innings. He struck out seven, walked two and failed to last five innings for just the second time in 17 starts this season.

JUMPING RIGHT IN

Arizona native Will Claye, the triple jump silver medalist at the Rio Olympics, attended the game and caught one of three pitching-machine pop flies during a between-innings break.

STREAKING

LeMahieu had two hits and reached base safely for the 29th consecutive game since Aug. 9, a career high.

TRAINER'S ROOM

Diamondbacks OF A.J. Pollock appears to be ahead of schedule in his recovery from a groin strain and could return to the lineup before the season ends.

UP NEXT

Rockies: LHP Jorge De La Rosa (8-7) is set to face the Diamondbacks for the fourth time this season. He has one win in those three previous outings.