Updated

Though still trailing in the race for the AL's best record, the Kansas City Royals will begin the playoffs at home.

The defending AL champions resume their pursuit of the first goal in Thursday night's series finale against the host Chicago White Sox.

Kansas City (91-67) was able to gain ground with Wednesday's 5-3, 10-inning victory and the Blue Jays splitting a doubleheader at Baltimore. The result also assured the Royals home-field advantage for the American League Division Series, and they sit one game back of Toronto for the league's top mark with four remaining.

The Royals, 51-30 at Kauffman Stadium, end the regular season with a three-game set at wild-card contender Minnesota. Toronto visits Tampa Bay for three after Thursday's matchup with the Orioles.

"Obviously, we would like home-field advantage throughout the whole entire postseason, but just got to see how that plays out," first baseman Eric Hosmer said. "To have the first round at least at home is definitely big for us."

After mustering 10 runs while losing four of five, Kansas City homered three times Wednesday, with Hosmer's two-run shot in the 10th providing the final margin.

"It was a huge hit for us," manager Ned Yost said.

The Royals did have center fielder Lorenzo Cain exit in the seventh inning after fouling a ball off his right knee. The team termed him day to day with a contusion.

Chicago (74-84) has lost six of eight and attempts to bounce back behind John Danks (7-14, 4.53 ERA), who'll aim to continue his career success against Kansas City in his final 2015 appearance.

Danks improved to 10-2 with a 2.57 ERA in 21 starts against the Royals by tossing a seven-hitter in a 12-1 win at Kauffman Stadium on Sept. 4. The veteran left-hander is 5-0 with a 3.38 ERA in eight meetings at U.S. Cellular Field, where he has recorded a 1.63 ERA in six starts since the All-Star break. He threw six-plus innings in a 2-0 decision July 17 for his second home win over Kansas City this season.

Several Royals regulars have struggled against Danks. Mike Moustakas, who had a two-run homer Wednesday, is 3 for 22 and Salvador Perez 4 for 28 with two homers. Alcides Escobar is 5 for 30 with 10 strikeouts, and Hosmer is 2 for 14 this season.

Danks, who has been backed by three runs or less of support in six of his last nine starts, gave up two runs over six innings against the New York Yankees on Saturday but was saddled with a 2-1 loss.

Kris Medlen (5-2, 4.30) takes the mound for Kansas City looking to recapture his mid-September form. After not permitting an earned run across 11 1/3 innings in consecutive road wins over Cleveland and Detroit, he was reached for six runs and nine hits in 3 2/3 innings in Saturday's 9-5 home loss to the Indians.

Medlen owns a 1.13 ERA on the road and a 6.99 mark at home this season and has won all three of his visiting starts. He allowed season highs of seven runs and 11 hits in 5 2/3 innings when opposing Danks on Sept. 4.

Chicago's Jose Abreu homered Wednesday to join Albert Pujols and Ryan Braun as the only players to hit 30 homers in each of their first two seasons. He's one RBI shy of matching Pujols as the only ones with 100 RBIs and 30 homers over that span.