On July 24, the 49–48 Twins acted as soft buyers, adding Atlanta lefty Jaime García to bolster a dilapidated starting rotation. Within a week, during which time they were swept by the Dodgers and lost two of three to Oakland, they pivoted, quickly, to sell mode, shipping closer Brandon Kintzler to Washington and García to the Yankees, after the veteran had made just one start for Minnesota.

And now, some five weeks later, the Twins have a realistic chance to become the most unlikely playoff team in MLB history. Last year’s club finished 59–103, nine games worse than any other team; in the World Series era, none of the 142 teams before the 2016 Twins that amassed 100 or more losses made the playoffs the following year.

Despite a recent slump, Minnesota still leads the AL’s muddled chase for the second wild card by half a game over the Angels, one game over the Orioles, and two to three and a half games over a handful of other teams. As of Thursday morning, FanGraphs projects the Twins to finish in the neighborhood of 83 wins, but in the American League, that might be good enough to qualify for October play: Those same projections peg the Twins’ playoff chances at 36.7 percent, just more than a month after those odds hit a post-April low of 3.6 percent on August 3, when the team’s record sat at 51–54 post-sale. They’ve climbed up the standings by adding together improvements across the roster — some understandable, some completely unexpected, and all questionable to persist through the final month of the season.

The rise starts with the pitching staff, which was already in sufficiently dire straits that a middling García represented a tangible upgrade. The current starting rotation has been reduced to overperforming veteran Ervin Santana, erratic youngster José Berrios, and pitchers who very recently didn’t belong in an MLB rotation. Kyle Gibson ran the second-worst ERA (6.31) of any pitcher who threw at least 80 innings in the first half; Bartolo Colón tallied an 8.14 ERA in 13 starts with Atlanta before moving to Minnesota; and Aaron Slegers, who doesn’t rank among the Twins’ top 30 prospects by either MLB or FanGraphs, made his second career MLB appearance on Wednesday — replacing in the rotation Dillon Gee, who was outrighted by the Rangers in June and made his first start for Minnesota on August 21.

Here we come...

Big Sexy and the crew heading to the @Twins booth at the @mnstatefair pic.twitter.com/OQZXK5yb4Q — Dustin Morse (@morsecode) September 1, 2017

Yet somehow, the team’s motley collection of arms has come through. In August, when the Twins went 20–10 to win the most games of any team that month, Minnesota’s rotation was worth 2.7 fWAR, sixth most in the majors and right behind the Cubs, Diamondbacks, and Nationals. Santana and Berrios bounced back from rough early-summer outings to combine for a 3.39 ERA in the month. Gibson has been a different pitcher in the second half, thanks to extreme boosts to his strikeout and ground ball rates and a reduction in walks and homers. Even the 44-year-old Colón has contributed, cutting his Atlanta ERA in half in Minnesota.

Similarly, the bullpen, which was already unreliable with Brandon Kintzler, seemed like it would collapse once its All-Star closer left on trade deadline day. Instead, resurgent journeyman Matt Belisle (40.0 percent strikeout rate since the start of August) and rookie pseudo-sidearmer Trevor Hildenberger (1.80 ERA over that span) have kept the bullpen from sinking.

The bats have also woken up since the calendar turned to August. Since the trade deadline, the Twins have hit for more power, struck out less, and generally been a more productive team at the plate.

The Twins Before and After the Trade Deadline Span ISO MLB Rank K% MLB Rank wRC+ MLB Rank Span ISO MLB Rank K% MLB Rank wRC+ MLB Rank Through July 31 0.154 25th 22.1 18th 93 18th Since August 1 0.218 2nd 19.6 6th 118 3rd (tie)

Two key hitters have led the way with remarkable late-summer turnarounds. Former top prospect Byron Buxton started the season with four hits in 49 at-bats, dampening the hope he had inspired with last September’s hot streak, and his 2017 OPS didn’t exceed .650 any day until August 18. But that month also brought another display of his lofty ceiling, as he’s posted a .325/.366/.610 since returning to the majors on August 1. Combine that offensive stretch with his league-best defense in center field, and the 23-year-old has been worth 4.7 bWAR this year — already tying the best marks that Twins greats Torii Hunter and Justin Morneau ever managed in a season in the Twin Cities.

Complementing Buxton’s latest starring effort is Jorge Polanco, a surprise contributor who never ranked better than 97th on any national prospect list. At the end of July, the shortstop’s slash line was .213/.265/.305, good for a 46 wRC+ that tied him as the worst hitter in the league (minimum 300 plate appearances). Since August 1, though, he’s hitting .363/.412/.661, which converts to a 180 wRC+ that’s the eighth-best among hitters with at least 100 PA in that span. The Twins don’t have the deepest lineup, but with Buxton, Polanco, and second baseman Brian Dozier all crushing the ball at the moment, they can at least score enough runs to assist the lackluster pitching.

Those factors all contribute to the Twins’ postseason pursuit, which is alive even after their recent swoon. It’s not as if the Angels, Orioles, or other wild-card hopefuls have played any more consistently this season. Even a 36.7 percent shot at a one-game playoff appearance is better than the Twins had any reason to expect just a month ago, let alone last winter as the team came off its worst season since moving to Minnesota in 1961.

As with the other wild-card contenders, whether the Twins can maintain their winning ways is an open question, but such variability is part of the sport’s excitement this September. The offense is still missing its best hitter, third baseman Miguel Sanó, who is on the disabled list with a shin injury and unlikely to return soon. Colón probably won’t keep twirling quality starts — three in a row now, for the first time in a full calendar year — given that his underlying numbers aren’t dissimilar from those he posted in Atlanta (his 5.07 FIP there nearly matches his 4.97 mark in Minnesota). Polanco certainly won’t keep hitting like Josh Donaldson. Instead, the Twins’ greatest advantages are circumstantial, and twofold: first, their current standing, where they have a slight lead in the stretch run; and second, their schedule, as they have the easiest remaining slate of the AL’s second-wild-card bunch, including seven games against a sputtering, rebuilding Detroit squad in the final week and a half.

For now, data derived from the Baseball-Reference Play Index reveals that the worst teams to reach the playoffs in the subsequent season are the 1990 Braves, 1998 expansion-year Diamondbacks, and 2010 Diamondbacks, who all finished 65–97. The 2007 last-year-of-Devil Rays, at 66–96, hold the AL record. Of course, with two wild-card spots in play and a historically low win total potentially claiming one of those bids, Minnesota possesses postseason-qualification advantages that previous 100-loss teams didn’t. But that context shouldn’t depress the Twins’ hopes: With just more than three weeks to play, they have a chance to set a record — a positive one, for the first time in a while.