The Detroit Tigers continued their improbable comeback on Thursday, defeating the Kansas City Royals 5-4 to take a two-game lead in the AL Central division.

Doug Fister pitched an impressive game, but the Tigers almost lost after giving up four runs in the eighth inning after holding a 4-0 lead. Fister set an American League record after striking out nine straight batters in the game and it took until the ninth inning for the Tigers to finally pull ahead.

Catcher Alex Avila hit a grounder with the bases-loaded to score Don Kelly and the winning run.

"Getting a win is big," Avila said. "We have to be able to win tight games like this. It's the only way we're going to be able to get in the playoffs and go far in the playoffs."

The win gave the Tigers a two-game advantage in the Central division over the White Sox, who lost to Tampa Bay 3-2.

The game was the final one the Tigers will play at home this season. They went 50-31 at Comerica Park and now are in firm control of the division after chasing the White Sox for most of the summer.

Fister's streak left him one behind of Tom Seaver for the major league record for consecutive strikeouts. It began in the top of the fourth inning when Fister struck out Salvador Perez and didn't end until Perez was up again, hitting a grounder in the seventh inning.

"It's crazy, to go through a whole lineup and strike everybody out," Royals outfielder Jeff Francoeur said. "And I don't think he threw more than four pitches to any of the batters."

Tigers first baseman Prince Fielder gave Fister a pat on the back after the streak ended.

"I said, 'Congratulations, man. You made history.' He was like, 'What are you doing?'" Fielder said. "He was locked in so it was kind of like, 'Get away from me.' I was like, 'All right, they'll tell you."

Fister pitched the Tigers to a 4-0 lead and retired 16 straight batters, but had no idea he set a record.

"Honestly, I had no idea," Fister said. "(Fielder) was yelling at me to step off during the inning, and I kind of looked at him. Normally, he'll do that, to slow me down, if I'm getting too quick. ... I thought that was kind of what he was doing there. He just said, 'Hey, step off.' I look at him, and he kept looking at me, and he said, 'Aw, I'll tell you later.'"

Detroit almost let his performance become worthless after giving up three runs in the eighth inning and one in the ninth to let the Royals tie the game. At 4-3 in the top of the ninth inning, Kansas City's Billy Butler mashed a 400-foot solo home run to tie the game off of Tiger reliever Joaquin Benoit.

In the bottom of the inning the Tigers loaded the bases after a double from Fielder, a walk to Delmon Young and an error by third baseman Mike Moustakas, which was his third of the game. Kansas City had five errors on the day.

The following play, Avila hit a grounder to first baseman Bryan Pena for an out, but there was no time to get the ball home, allowing the winning run to score.

"Pena still made a great play on that one," Fielder said. "Baseball is really hard because even if you're good, you have to be a little lucky, too."

Kansas City committed four errors in the first two inning to help give Detroit a 4-0 lead. Moustakas had two errors on one play, mishandling a ground ball and then making a bad throw.

The Tigers will open a series against the Minnesota Twins on Friday night and will look to maintain or extend their division lead. The team has won eight of 15 games against the Twins this season.