Josh Hamilton drops a fly ball in center field for a two-run error in Oakland’s six-run fourth inning.
Josh Hamilton drops a fly ball in center field for a two-run error in Oakland’s six-run fourth inning.
Robert Galbraith/Reuters

The Athletics captured the AL West with another improbable rally in a season full of them, coming back from four runs down and a 13-game division deficit to stun the two-time defending league champion Texas Rangers, 12-5, Wednesday afternoon in Oakland.

Josh Hamilton dropped a fly ball in center for a two-run error that put the A’s (94-68) ahead, 7-5, in a six-run fourth inning.

While Hamilton’s Rangers (93-69) are headed to the new one-game, wild-card playoff, the A’s get some time off before opening the division series in their first postseason appearance since 2006.

Advertisement - Continue Reading Below

The A’s needed a sweep and they delivered to win their first division crown in six years and 15th in all. They overcame a five-game deficit in the final nine days and took sole possession of the West’s top spot for the first time this year.

‘‘It shows how important Game 162 is,’’ Oakland’s Jonny Gomes said. ‘‘I don’t think it took 162 to games to check the character of this ball club.’’

Grant Balfour retired Michael Young on a fly to center for the final out, then raised his arms as the A’s streamed out of the dugout to celebrate.

Coco Crisp hit a tying two-run double in the fourth against Derek Holland (12-7). Brandon Moss drove in three runs, including a two-run single in a four-run eighth.

Rookie Evan Scribner (2-0) left the mound to a standing ovation from the sellout crowd of 30,067 and wound up the winning pitcher. He allowed two hits and struck out two in three scoreless innings after replacing struggling starter A.J. Griffin.

‘‘Anything can happen in the long season,’’ said Rangers pitcher Yu Darvish, who will start the wild-card game. ‘‘That’s why we play 162 games.”

Nationals 5, Phillies 1 — Washington secured home-field advantage throughout the postseason by beating Philadelphia for its majors-high 98th victory, with Ryan Zimmerman, Tyler Moore, and Michael Morse homering.

Dodgers 5, Giants 1 — Clayton Kershaw finished with a majors-leading 2.53 ERA, Adrian Gonzalez singled in the go-ahead run in the sixth, and host Los Angeles defeated San Francisco. Giants catcher Buster Posey went 0 for 2, finishing with a .336 average to claim the NL batting title.

.   .   .

In other games — Chipper Jones rapped a single to right field in his final regular-season at-bat and Atlanta beat host Pittsburgh, 4-0. Atlanta pitcher Ben Sheets, unlikely to make the postseason roster, pitched one scoreless inning in what he’s said will be his final major league appearance, striking out two while hitting 96 m.p.h. on the radar gun . . . Miguel Cabrera became the first player in 45 years to achieve the Triple Crown, Austin Jackson knocked in the only run of the game, and Detroit topped host Kansas City, 1-0 . . . Dan Johnson hit his first three homers of the season and the visiting White Sox routed Cleveland, 9-0 . . . Rookie righthander Shelby Miller took a no-hit bid into the sixth inning in his first career start, Matt Carpenter had a run-scoring single, and host St. Louis beat Cincinnati, 1-0 . . . Casper Wells tied a career high with five RBI and the Mariners closed out the visiting Angels, 12-0 . . . Brandon Morrow struck out a season-high 11, Omar Vizquel wrapped up his 24-year career, and Toronto beat visiting Minnesota, 2-1 . . . The Cubs’ Bryan LaHair homered and singled in the winning run in the bottom of the ninth for a 5-4 win that sends the Astros to the American League after setting a franchise record for losses in a season . . . Chase Headley drove in two runs, finishing with an NL-leading 115 RBIs, and San Diego beat host Milwaukee, 7-6 . . . Jeff Francis earned his first win in more than a month and Colorado used two unearned runs to beat Ian Kennedy and Arizona, 2-1, in Phoenix . . . Ike Davis hit his 32d homer to help the visiting Mets tip the Marlins, 5-4.