ARLINGTON, Texas (AP) — Jose Altuve drove in two runs and scored two more for the AL-best Houston Astros in a 5-3 win over the Texas Rangers and their All-Star starter Martín Pérez on Wednesday.

The reigning AL champion Astros will enter September at 84-47, matching their best record through 131 games.

“We just can continue to do the same and come out of the month healthy. ... There are some guys on this team that have had big Septembers,” Astros manager Dusty Baker said when asked what his team needed to do down the stretch.

Altuve drew a leadoff walk to start the game and scored on Trey Mancini’s single. After Texas went ahead 2-1 on Corey Seager’s 29th homer, the Astros regained the lead for good on Altuve’s two-run double that ricocheted off the base of the right-center field wall in the second inning.

Seager extended his career high for homers with his drive into the Rangers bullpen in right-center after Marcus Semien walked and stole his 20th base. That gave Semien his first career 20-20 season, with all of the second baseman's 20 homers coming since May 28. Texas committed a half-billion dollars last winter to sign the two middle infielders.

“It's definitely a cool milestone,” Semien said.

Astros right-hander Cristian Javier (8-9) struck out seven and walked three while allowing three runs on 96 pitches over five innings. Five days after working three innings out of the bullpen in a loss to Baltimore, Javier needed 38 pitches to get through the first, and Baker said he was one batter away from an early exit.

“He got it together and he fought through that first inning. ... He was good the next four,” Baker said.

“The breaking ball just wasn’t working and a lot of the hitters, I think were just sitting on a fastball and that’s why they were able to get a lot of foul balls there,” Javier said through a translator. “Just staying focused, and I just thought about releasing my breaking pitches a little bit higher and that’s what happened.”

Rafael Montero, again filling the closer’s role with Ryan Pressly injured, worked the ninth for his 10th save in 12 chances.

Pérez (10-5) gave up five runs on nine hits and needed 91 pitches (63 strikes) to get through five innings. The left-hander, who finished 1-3 with a 4.24 ERA over his five starts in August, struck out five and walked four.

“Martin kind of pitches around the zone. ... He’s been successful doing that,” Texas interim manager Tony Beasley said. “That’s a team that’s very stingy and is going to force you in the zone. And so a lot of those pitches really just missed, but they weren’t offering at them, and he wasn’t getting the call.”

Kyle Tucker had at two-run single in the fourth to make it 5-2. The Astros had loaded the bases after two outs, starting with Altuve drawing a walk.

Semien doubled in the fifth and scored on a single by Nathaniel Lowe, the AL player of the week. Lowe added a double in the eighth for his MLB-best 56th hit in 39 games since the All-Star break and pushed his season batting average to .301.

STREAK SNAPPED

Rangers slugger Adolis García went 0 for 4 with two strikeouts, ending his 25-game on-base streak that was the longest in his career — and the longest active in the majors. His 23-game hitting streak ended Sunday when he was 0 for 3 with two walks.

20/20 TIMES 2

Semien joined García (21 homers, 22 stolen bases) with a 20/20 season. The only Rangers teammates to do that were Nelson Cruz and Ian Kinsler in 2009.

GOT THE BOOT

The season series wraps up with three games next week in Houston, but the Astros have already secured the Silver Boot trophy for the sixth year in a row. Houston is 12-4 and won five series so far.

TRAINER’S ROOM

Astros: LF Chas McCormick was a late scratch from the lineup because of right pinkie, a day after playing for the first time since he dislocated that finger diving into first base on Aug. 24. But he entered Wednesday as a defensive replacement in the ninth and caught a flyball in left. ... DH Yordan Alvarez (hand) missed his third game in a row.

UP NEXT

Astros: After being off Thursday for the second time in four days, the Astros open a three-game series Friday night at the Los Angeles Angels. Lance McCullers (1-1, 1.69 ERA) makes his fourth start since his return Aug. 13 after not pitching since the playoffs last year because of a right flexor tendon strain.

Rangers: Rookie right-hander Glenn Otto (6-8, 4.79), who was 2-1 with a 2.93 ERA in his five August starts, takes the mound Thursday night when the Rangers open a four-game series at Boston.