Ronald Torreyes was hit by a bases-loaded pitch in a three-run 12th inning to give the Minnesota Twins a 9-8 victory over the Chicago White Sox on Tuesday night that kept their lead in the American League Central at five games.

Marwin Gonzalez hit the tying two-run single off José Ruiz (1-4). Then Torreyes, a September roster addition who has only six plate appearances for the Twins this season, crouched in front of a 2-1 fastball with his bat ready to swing before holding off. The ball grazed his right forearm as he lowered it over the plate, triggering the celebration by the Twins after the most unusual walk-off play.

The Twins, who improved to 13-5 against the White Sox this season, trimmed their magic number for clinching the division to seven. Any combination of wins by Minnesota and losses by Cleveland over the remaining 11 games will give the Twins their first title since 2010. The Indians beat Detroit earlier in the evening.

Chicago White Sox pitcher Ross Detwiler reacts after giving up a three-run home run to Minnesota Twins' Miguel Sano in the third inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

Chicago White Sox pitcher Ross Detwiler reacts after giving up a three-run home run to Minnesota Twins' Miguel Sano in the third inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

Ryan Cordell hit a two-run homer in the top of the 12th off Ryne Harper (4-2) for the White Sox, one of four homers allowed by Twins relievers. American League batting leader Tim Anderson went deep in the 11th, before a sacrifice fly by Mitch Garver tied the game again in the bottom of the inning.

The Twins, who nearly three weeks ago broke the major league single-season mark for home runs set last year by the New York Yankees with 267, accomplished another long ball feat by becoming the first team in history with five players to reach the 30-homer mark.

Miguel Sanó arrived there with a three-run shot to the third deck in left-center field off Ross Detwiler, joining Nelson Cruz (37), Max Kepler (36), Eddie Rosario (31) and Mitch Garver (30). That gave the Twins 289 home runs, two more than a Yankees team trying to maintain possession of the record.

Minnesota Twins' Miguel Sano celebrates his three-run home run off Chicago White Sox pitcher Ross Detwiler in the third inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

Minnesota Twins' Miguel Sano celebrates his three-run home run off Chicago White Sox pitcher Ross Detwiler in the third inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

The homer by Sanó was estimated at 482 feet, the second-longest in Target Field history. Jim Thome, now a special assistant to the general manager for the White Sox who was at the game, hit one for the Twins pegged at 490 feet on July 17, 2011.

Detwiler made his first appearance in more than two weeks, subbing for All-Star Lucas Giolito, who was shut down on Monday because of a mild back muscle strain. The absence of Giolito, who is sixth in the American League with a 3.41 ERA and second in White Sox history behind Chris Sale (11.82 in 2015) in strikeouts per nine innings (11.62), was a clear break for the Twins. They took advantage with a five-run third inning, starting with Ryan LaMarre's leadoff home run. Rosario hit an RBI double, and Sanó followed with his blast.

Twins starter Martín Pérez left with 10 hits allowed in 4 2/3 innings, after an RBI single by James McCann in the fourth and a sacrifice fly by Tim Anderson and a run-scoring single by American League RBI leader Jose Abreu in the fifth. Reliever Trevor May stranded two runners to end that inning with a strikeout, but he surrendered back-to-back homers to rookie Zack Collins and Adam Engel in the sixth to let the White Sox tie the game. Combined, Collins and Engel have 20 home runs in 986 career major league at-bats.

Chicago White Sox pitcher Ross Detwiler throws against the Minnesota Twins in the first inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

Chicago White Sox pitcher Ross Detwiler throws against the Minnesota Twins in the first inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

Pérez has a 6.22 ERA in his last nine starts, with 62 hits allowed in 46 1/3 innings, decreasing any possibility he'd be in a postseason rotation for the Twins.

TIM AT THE TOP

Anderson went 4 for 6 to raise his average to .336 and stretch his lead in the batting race over New York Yankees infielder D.J. LeMahieu (.329). In his last 30 games, the 26-year-old Anderson, who hit only .240 last season, is batting .385 in 135 at-bats.

Minnesota Twins pitcher Martin Perez throws against the Chicago White Sox in the first inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

Minnesota Twins pitcher Martin Perez throws against the Chicago White Sox in the first inning of a baseball game Tuesday, Sept. 17, 2019, in Minneapolis. (AP PhotoJim Mone)

TRAINER'S ROOM

Kepler was held out for the third straight game because of soreness in his left shoulder, which also kept him out of four games last week. Kepler said he's feeling better, and none of the tests or scans revealed any cause for concern. He played the doubleheader the Twins swept in Cleveland on Saturday and felt more discomfort during his swings and misses.

"It was a long day and, in some ways, he gutted it out," manager Rocco Baldelli said.

UP NEXT

RHP Dylan Covey (1-8, 7.98 ERA) will take the mound for the White Sox on Wednesday night for the series finale, seeking his first win since May 31 against Cleveland. In 31 career appearances against division opponents, covering 122 1/3 innings, Covey is 2-15 with a 5.66 ERA.

RHP Jake Odorizzi (14-6, 3.60 ERA) will pitch for the Twins, who have won seven of his last eight starts.

More AP MLB coverage: https://apnews.com/MLB and https://twitter.com/AP_Sports