SEATTLE (AP) — Colby Rasmus' broken-bat RBI single capped Houston's rally from a three-run deficit, and the Astros retook the lead in the race for the second AL wild-card spot, beating the Seattle Mariners 7-6 on Wednesday night.

A day after being passed by the Angels, the Astros moved back in front of Los Angeles, which lost at home to Oakland. The Astros are a half-game ahead going into their final series of the season beginning on Friday in Arizona.

Astros relievers Will Harris and Oliver Perez worked through two errors by rookie shortstop Carlos Correa for a scoreless eighth.

Luke Gregerson pitched the ninth for his 31st save, capped when center fielder Carlos Gomez caught a line drive by Franklin Gutierrez and doubled pinch-runner James Jones off first base to end the game.

Trailing 6-3, the Astros got a three-run homer from Chris Carter, his 24th of the season, in the sixth inning to draw even. Rasmus' blooper off Danny Farquahar (1-7) over a drawn-in infield scored pinch-runner Jonathan Villar in the seventh to give Houston the lead.

Kyle Seager and Nelson Cruz hit back-to-back homers in the fifth for Seattle. Seager hit a three-run shot, his 26th of the season and a new career-high. Cruz followed with his 44th to give Seattle a 6-3 lead, putting him one behind Baltimore's Chris Davis for the most in the majors.

Houston's bullpen managed to pitch shutout ball over the final four innings. Seattle had runners on the corners and two outs in the seventh but Tony Sipp (3-4) got Brad Miller to fly out and end the threat.

Houston took the lead in the seventh after Evan Gattis tripled with one out, helped by Miller in right field taking a bad step and slipping. Rasmus followed with a broken-bat blooper over the infield.

Luis Valbuena hit his 24th homer of the season for Houston, a solo shot as part of a three-run fifth inning. Jose Altuve and Correa also had RBIs in the inning.