ANAHEIM, Calif. (AP) — Shohei Ohtani scored the go-ahead run in the sixth inning and the Los Angeles Angels snapped a six-game losing streak with a 3-2 victory over the Houston Astros on Thursday night.

Ohtani tried to score the winning run during Wednesday night's 9-5 loss to Houston in 12 innings, but was called out after a perfect throw from right fielder Chas McCormick. This time, the two-way star was safe as the Angels avoided their first four-game sweep against the Astros since 2013 and kept Houston's magic number at three for clinching the AL West.

What You Need To Know

  • The Angels defeated the Astros 3-2 Thursday night in Anaheim

  • Shohei Ohtani scored the go-ahead run in the sixth inning when Jack Mayfield lined a double down the left-field line to score Ohtani and Jared Walsh

  • Los Angeles snapped a six-game losing streak and also snapped an eight-game skid at home, their longest since 1994

  • Up next: the Angels open their final home series of the season against Seattle on Friday

The game was tied 1-all when Jack Mayfield lined a double down the left-field line off Lance McCullers Jr. (12-5) to score Ohtani and Jared Walsh. Ohtani got aboard on a one-out walk and stole second. The Astros challenged the play after it appeared shortstop Carlos Correa might have tagged Ohtani before his foot reached the bag, but the call was upheld.

Ohtani has 24 stolen bases this year. He is the fourth player in American League history to have at least 45 home runs and 24 steals in one season, joining Jose Canseco, Ken Griffey Jr. and Alex Rodriguez.

Mayfield had six RBIs in the four-game series against his former team. The Angels also snapped an eight-game skid at home, their longest since 1994.

Jason Castro smashed a pinch-hit homer to center with two outs in the ninth off Raisel Iglesias to draw Houston within a run. It was the second straight night Castro went deep against his former club.

Jose Altuve followed with a bloop hit before Iglesias got Jose Siri on a check-swing third strike to stop Houston's four-game winning streak.

Iglesias picked up his 33rd save, which is second in the American League. Austin Warren (2-0) worked 1 1/3 innings of scoreless ball.

Alex Cobb had his second straight solid start for Los Angeles since coming off the injured list. The right-hander gave up only one run on four hits and struck out four in 5 2/3 innings after throwing five innings of shutout ball last Thursday against the Chicago White Sox.

McCullers, who had gone 3-0 in his last six starts, took his first loss since Aug. 15 against the Angels. The right-hander went six innings and allowed three runs on two hits with five strikeouts.

Houston had the bases loaded with one out in the fourth but couldn’t get anything across. Yuli Gurriel was called out on strikes and Correa grounded into a fielder’s choice.

The Angels took a 1-0 lead in the bottom half on Walsh’s sacrifice fly.

Houston tied it in the sixth on Correa’s two-out RBI single.

Trainer's room

Astros: DH/OF Yordan Alvarez did not play due to general soreness. ... RHP Ryne Stanek was reinstated from the paternity list. ... RHP Jake Odorizzi (right foot soreness) is scheduled to come off the injured list Sunday and start at Oakland. ... Manager Dusty Baker refused to say if OF Michael Brantley (right knee discomfort) is likely to come off the IL before the end of the regular season. ... RHP Pedro Báez (right shoulder soreness) will make at least one rehab appearance at Triple-A Sugar Land.

Angels: RHP Dylan Bundy (right shoulder strain) and OF Justin Upton (right lumbar strain) were transferred to the 60-day injured list, ending their seasons. ... LHP Reid Detmers was reinstated from the injured list and optioned to Triple-A Salt Lake.

Up next

Astros: Begin a three-game series at Oakland. RHP Zack Greinke (11-6, 4.11) is 0-3 with a 7.56 ERA in his last five starts.

Angels: Open their final home series of the season against Seattle. LHP José Suarez (7-8, 3.67 ERA) has allowed three or fewer runs in six consecutive starts.