ANAHEIM, Calif. — A summer surge that transformed the Oakland Athletics from perennial bottom-dwellers to playoff contenders went from surprising to downright absurd during a two-day span in Texas last month.

On July 24, the A’s trailed the Rangers 10-2 after six innings. Oakland scored 11 consecutive runs – three in the seventh inning, four in the eighth, one in the ninth and three in the 10th – to pull out a 13-10 victory, with Khris Davis smashing a go-ahead three-run homer in the 10th.

The next night the A’s trailed Texas 5-1 after six innings. Davis hit a three-run homer against Cory Gearrin in the seventh to cut Oakland’s deficit to 5-4.

Then, with two outs in the ninth and a 2-and-2 count, Davis drove a high-and-away fastball from Jose Leclerc into the upper deck in right field for a two-run homer and a stunning 6-5 win.

“That was one of the more impressive, unbelievable games I’ve been a part of,” catcher Jonathan Lucroy said. “Being down by that much, and all of a sudden we score all those runs, and Khris Davis comes up, we’re down to our last strike, and he hits an opposite-field home run …

“The pitch was 97 mph, at the top of the zone and away. That swing kind of epitomized our run. Like, geez, you don’t see stuff like that very often.”

These upstart A’s, who finished last in the American League West in each of the last three years, have grown accustomed to late-inning rallies, which, along with one of baseball’s best bullpens, have fueled their ascent from 11 games back in the wild-card race June 15 to a playoff position in early August.

With Sunday’s 8-7 win over the Angels, the A’s are a major league-best 36-12 since June 16, moving within 21/2 games of first-place Houston in the division race and 11/2 games ahead of Seattle for the second wild-card spot.

Oakland came from behind in 19 of those 36 victories, overcoming deficits of eight runs, six runs, five runs, four runs twice and three runs three times. The A’s scored the winning run in the eighth inning or later in 14 of the victories, and 12 were by one run.

They are 23-10 in one-run games, the best mark in baseball. They lead the major leagues with 217 runs and a .266 batting average in the seventh inning or later, compared to a .240 mark in innings one through six.

“I don’t really know the secret,” Davis said. “It’s been indescribable. We’re getting contributions from everybody throughout the lineup. It’s not just Jed (Lowrie). It’s been Marcus (Semien) one night, (Stephen) Piscotty another night … it’s been spread all around. It’s kind of contagious.”

Davis, who has hit more home runs (119) than anyone in the major leagues since 2016, has been a force in the cleanup spot, recovering from a slow start as he transitioned from an outfielder to a full-time designated hitter to hit .258 with an .895 on-base-plus-slugging percentage, 34 home runs and 93 RBI.

Third baseman Matt Chapman is batting .275 with an .861 OPS, 16 home runs and 41 RBI, and has established himself as one of the best defenders at any position in the majors.

Lowrie (.267, .806 OPS, 18 HRs, 70 RBI), first baseman Matt Olson (.235, .765 OPS, 22 HRs, 55 RBI) and right fielder Piscotty (.255, .761 OPS, 15 HRs, 52 RBI) have provided solid production and power.

“We have several guys who can change the game with one swing of the bat, guys with exceptional power, like Khris Davis, Matt Olson and Matt Chapman,” Lucroy said. “We have other guys, like Jed Lowrie, who are professional hitters, who will get on base, take a walk, have good at-bats when we need them. We talk a lot about that here, having good at-bats, especially late in games.”

The late-game heroics wouldn’t be possible without a relief corps that was among baseball’s best for the first 31/2 months of the season and has gotten even better in the last three weeks.

Closer Blake Treinen, acquired from Washington in July 2017, has anchored the bullpen. The right-hander, who added a cut-fastball to his 98 mph fastball and nasty slider, is 5-2 with an 0.92 ERA, and has converted 30 of 34 save opportunities.

He has 79 strikeouts and 19 walks in 59 innings, three of them coming in the ninth inning of Sunday’s victory in Angel Stadium.

Right-handers Lou Trivino (8-2, 1.57 ERA, four saves), Yusmeiro Petit (5-2, 3.22 ERA) and Emilio Pagan (3-0, 3.28 ERA) have been effective in high-leverage roles, but Manager Bob Melvin now has two more closers to choose from.

“All our starters have to do is get through four or five innings and keep the game close, and our bullpen will come in, shut teams down and give our lineup a chance to score runs,” Lucroy said. “For me, it’s shortening games. The other team has to play nine innings. We only have to play, and this is a figure of speech, five or six innings because we have a bullpen that’s one of the best in the league.”

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.