DENVER (AP) -- Michael Cuddyer homered, Rafael Ynoa drove in three runs and the Colorado Rockies beat the Arizona Diamondbacks 8-3 on Sunday.
The Rockies swept a four-game series for the first time this season. It was their second sweep in as many homestands after going three months without one.
Brandon Barnes had two hits and two RBIs while Wilin Rosario also had two hits and scored three runs for Colorado, which is trying to avoid a third straight last-place finish.
The Rockies' offense came into the homestand having scored 10 runs in six games but exploded against the Dodgers and Diamondbacks. Colorado scored 61 runs in its final six games at Coors Field this season to climb out of the NL West cellar, three games ahead of reeling Arizona.
Rookie right-hander Christian Bergman (3-4) allowed two runs on six hits and struck out three in 5 2-3 innings to pick up the victory.
Mark Trumbo homered twice and drove in all three runs for the Diamondbacks, who have lost six in a row and 13 of 16.
DJ LeMahieu got things rolling for Colorado with an RBI single in the second and Barnes made it 3-0 with a two-run double in the third.
The Rockies broke it open in the fifth off starter Wade Miley (8-12). Stubbs had a run-scoring single and Ynoa doubled with the bases loaded to knock in two more and give Colorado a 6-0 lead.
Miley allowed six runs on eight hits in 4 1-3 innings.
Trumbo hit a two-run homer off Bergman in the sixth to make it 6-2.
Cuddyer led off the eighth with a home run off reliever Matt Stites, and Ynoa drove home another with a single to left to make it 8-2.
Trumbo homered off Juan Nicasio to start the ninth. It was his first mult-homer game of the season and fourth of his career.
Rockies: 1B Justin Morneau was given the day off for rest. This was a planned rest for Morneau, who entered Sunday tied with Pittsburgh's Josh Harrison in the NL batting race.
Diamondbacks: RHP Josh Collmenter (10-8) will face the Minnesota Twins for the first time while trying to set a career high in wins. Collmenter also had 10 wins in 2011.
Rockies: Rookie LHP Tyler Matzek will make just his 19th career start Monday and four will have come against the San Diego Padres. Matzek threw a three-hit shutout against San Diego on Sept. 5 for his first win against the Padres.