Updated

Justin Upton hit a two-out, two-run homer off closer Rafael Betancourt in the ninth inning to help the Arizona Diamondbacks beat the Colorado Rockies 9-7 on Thursday in a game that was briefly delayed by a swarm of bees.

Upton sent a 93-mph fastball from Betancourt (1-1) over the right field fence for his first homer in two weeks.

Willie Bloomquist and Ryan Roberts also drove in two runs apiece as the Diamondbacks won for the third time in 12 contests.

J.J. Putz escaped a bases-loaded jam in the ninth by getting Ramon Hernandez to hit into a game-ending 5-4-3 double play for his seventh save in nine chances.

The buzz surrounding this game, though, centered on the bees that invaded the stadium, taking over a camera bay next to the Rockies' dugout in the fifth inning. They remained stuck to a railing until a beekeeper arrived an inning later to vacuum up the bees and relocate them.

Lately, Coors Field has resembled "Wild Kingdom," with a squirrel scampering into the outfield grass the night before.

Troy Tulowitzki hit a two-run homer off starter Trevor Cahill and Jordan Pacheco added a solo shot to help stake the Rockies to an early 4-1 lead.

But it wouldn't last. Bloomquist ignited a four-run eighth with an RBI single off Rex Brothers. Jason Kubel, Paul Goldschmidt and Roberts also added run-scoring singles.

The three-run cushion wouldn't be enough as David Hernandez was roughed up in the eighth. He loaded the bases and then walked Dexter Fowler to bring in a run. Michael Cuddyer sent a chopper to Roberts, who booted the grounder to allow another run to score.

With the bases still full, Marco Scutaro drew another walk to tie the game at 7.

Brad Ziegler (2-1) relieved Hernandez and promptly gave up a sinking liner to pinch-hitter Wilin Rosario. But Upton made a sliding catch in right to quell the threat.

Gerardo Parra had a one-out double in the ninth and stole third. After Betancourt struck out Bloomquist, Upton drilled his fourth homer of the season.

Putz started out the ninth in rocky fashion, giving up singles to Carlos Gonzalez, Tulowitzki and Todd Helton. The Rockies sent pitcher Alex White to the plate to pinch hit for Betancourt and he took a called third strike on a 3-2 count.

Then, Hernandez hit a weak grounder to Roberts to end the threat.

Rockies starter Juan Nicasio had a scare in the first inning when Bloomquist sent a liner straight at him. Nicasio turned his back just in time and was struck on the right thigh.

The play was eerily reminiscent of the line drive that hit Nicasio in the right temple last August, when he suffered a fractured skull along with a neck injury. Doctors had to perform emergency surgery to insert pins into the cracked C-1 vertebra and attach a small metal plate to the back of his neck.

Nicasio made a remarkable recovery to become one of the Rockies' most reliable pitchers this season.

Soon after being hit, manager Jim Tracy and trainer Keith Dugger popped out of the dugout to check on him. Nicasio threw a few warmup pitches to test the leg, before motioning he was all right.

But he appeared rattled and walked the next two batters. Nicasio worked his way out of the jam without any damage.

The Rockies got off to a quick start in the first as Tulowitzki lined a two-run shot to left. It was his first homer since April 27.

Relying on a 95-mph four-seam fastball, Nicasio retired nine straight at one point, before running out of steam and allowing a walk to Aaron Hill to start the fifth.

This may have played a role: Shortly after Nicasio took the mound for the fifth, the game was momentarily halted by bees that just appeared out of nowhere.

Nicasio gave up one run in 4 2-3 innings. He also struck out seven, but was wild as well, walking five.

NOTES: Cahill surrendered four runs and five hits in five innings. ... Diamondbacks OF Chris Young (shoulder) hit a grand slam for Class A Visalia on Wednesday. He will now move on to Triple-A Reno for his rehab assignment. ... The Diamondbacks kick off interleague play with a visit to Kansas City on Friday night. They are 9-3 at Kauffman Stadium. ... Rockies LHP Jorge De La Rosa (shoulder) was scheduled to start for Double-A Tulsa on Thursday night. ... The Rockies host the Seattle Mariners on Friday night, with White (0-2) facing RHP Kevin Millwood (1-4), who spent last season with Colorado. ... The Rockies issued nine walks against Arizona on Thursday.