ARLINGTON, Texas (AP) -- Carlos Gomez scored the go-ahead run in the eighth inning on a wild pitch and the Texas Rangers moved up in the AL wild-card race, holding off the Los Angeles Angels 10-9 Friday night in a game that lasted more than 4 hours.
The matchup took 4 hours, 33 minutes, setting franchise records for both teams as the longest nine-inning game in club history.
Texas stopped the Angels' three-game winning streak and closed within three games of Minnesota for the second wild-card spot. Los Angeles is 1 games behind the Twins.
The Angels loaded the bases with two outs in the ninth before Alex Claudio (4-1) retired Eric Young Jr. on a grounder. Young had entered in the eighth as a pinch-runner for Albert Pujols, who had four hits and drove in four runs.
Pujols now has 1,904 RBIs and moved past Willie Mays into ninth place on the career list.
Cam Bedrosian (4-4) threw the wild pitch that let Gomez score.
Brandon Phillips and Justin Upton made their Angels debuts a day after being acquired in trade. Upton doubled, singled and scored a run, and also made an error in left field. Phillips had a hit and scored.
It was 9-all when Gomez walked in the eighth, stole second and advanced to third on a throwing error by catcher Martin Maldonado. He scored when Bedrosian's pitch in the dirt to Mike Napoli skipped away from Maldonado.
Gomez also homered in the Rangers' first game without injured third baseman Adrian Beltre, who might miss the rest of the season with a strained left hamstring.
Gomez and Shin-Soo Choo homered in the sixth as Texas took a 9-4 lead.
Joey Gallo also connected for Texas, hitting his 37th homer and tying Yankees rookie Aaron Judge for the most in the AL.
Rangers starter Cole Hamels allowed five hits and four runs in five innings.
Ten percent of the revenue from ticket sales, concessions and merchandise during this series will be donated to relief efforts for those affected by Hurricane Harvey.
The Rangers wore shirts during batting practice with the words "No matter where we ball, Texas stands tall," with the Rangers and Astros logos underneath. The shirts will be on sale to the public later this week with proceeds going to hurricane relief.
Angels: RHP Garrett Richards is close to returning from a biceps injury and could be activated this weekend.
Rangers: RHP Keone Kela (shoulder) threw a 25-pitch bullpen session and is scheduled to throw another bullpen next week.
Angels: RHP Ricky Nolasco is making his fourth start and looking for his first win against the Rangers.
Rangers: RHP A.J. Griffin is making his 14th start and working on extended five days of rest after a 6-5 loss to Oakland on Aug. 27.