(DENVER) — Ryan McMahon hit a walk-off grand slam after committing an error in the ninth inning that allowed the Tampa Bay Rays to score the go-ahead run, and the Colorado Rockies rallied for a 10-7 victory in their home opener Friday.

McMahon sent the first pitch he saw from reliever Jason Adam over the fence in right-center to set off a roar from the sellout crowd at Coors Field.

After leading 6-2 in the ninth, the Rockies let the Rays take a 7-6 lead as Ben Rortvedt scored the tiebreaking run when McMahon made a throw in the dirt from third base that converted first baseman Kris Bryant couldn’t scoop.

McMahon made up for that in a big way with his first homer of the season, propelling the Rockies to their second win in front of 48,399 fans on a sun-splashed afternoon. Colorado improved to 17-13 in home openers at Coors Field since the hitter-friendly park opened in 1995.

Rays reliever Pete Fairbanks (0-1) walked the first three hitters to start the ninth before giving way to Adam, who promptly struck out Bryant. That set the stage for McMahon.

Jalen Beeks (1-0) earned the win by finishing off the top of the ninth.

Ezequiel Tovar hit a go-ahead, two-run homer in the sixth inning and Bryant added some insurance by lining his first homer of the season in the eighth.

But the four-run cushion didn’t hold up as the Rays rallied with four straight hits off reliever Justin Lawrence. Rortvedt tied the game with a two-run single, then raced home on McMahon’s errant throw.

Zack Littell was solid for Tampa Bay in a no-decision, allowing one run over five innings. He struck out five.

Colorado starter Austin Gomber threw 41 pitches in the first inning and was taken out after the fourth. He struck out seven and gave up two runs.

The temperature was 75 degrees at first pitch, making it the warmest April home opener in Rockies history.