OAKLAND, Calif. (AP) — Ryan McMahon hit a two-run home run in the 12th inning, and the Colorado Rockies hung on to beat the Oakland Athletics 4-3 on Wednesday night.

Elias Díaz had three hits including a two-run home run, while Brendan Rogers and Hunter Goodman each added a pair of hits to help Colorado snap a four-game losing streak. Before the skid, the Rockies had won seven consecutive games for their longest streak in nearly five years.

Jake Cave began the 12th inning at second base and advanced to third on Ezequiel Tovar’s groundout. McMahon then hit his ninth homer of the season in a 2-2 slider from Kyle Muller (0-1).

The A’s scored an unearned run in the bottom of the 12th and had two runners on base before Matt Koch got Max Schuemann to fly out for his first save of the season.

Nick Mears (1-3) retired four batters for the win.

JJ Bleday homered for the A’s, who have lost 11 of 13.

The game drew a crowd of 3,617, the fifth-lowest at the Oakland Coliseum this season.

One day after rallying from three runs down late to beat the Rockies 5-4, the A’s nearly pulled off another comeback when Zack Gelof hit a two-out RBI single in the ninth inning to force extras.

The Rockies got the potential go-ahead run to third in the 10th then struck out three times in the 11th before coming through in the 12th.

Oakland reliever Lucas Erceg made a stellar defensive play in the top of the 10th to keep the game tied when he barehanded a comebacker by Brenton Doyle and threw to first for the final out of the frame.

Díaz fell a triple shy of hitting for the cycle. The Rockies’ catcher got Colorado rolling when he crushed a hanging slider from A’s starter Mitch Spence in the first inning, his first home run since May 8.

Díaz also singled in the third and doubled in the fifth before striking out swinging and grounding into a double play in his final two at-bats. It was his 16th multi-hit game of the season, tying Tovar for the team lead.

Rockies starter Austin Gomber had six strikeouts and allowed one run and five hits in eight innings. In four May starts, Gomber has allowed two runs in 26 2/3 innings for a 0.67 ERA.

TRAINER’S ROOM

Rockies: LHP Kyle Freeland, on the injured list with a left elbow strain, threw a 15-pitch bullpen session and will throw again on Thursday.

UP NEXT

Rockies RHP Ryan Feltner (1-5, 5.69 ERA) faces the A’s on Thursday for the first time in his career. Oakland counters with RHP Joey Estes (1-1, 9.35), who is also making his first start against Colorado.

___

AP MLB: https://apnews.com/hub/mlb

Brought to you by www.srnnews.com