Jake Peavy's last start of the season, and perhaps final for the White Sox, went according to plan until the ninth inning on Tuesday night.

Then Travis Hafner hit a pinch-hit, game-tying home run and the Cleveland Indians went on to defeat the White Sox 4-3 in 12 innings in front of 10,015 at Progressive Field.

Jason Donald's two-out single to left field off Nate Jones gave the Indians their sixth walkoff victory of the season. Lonnie Chisenhall doubled with one out against Matt Thornton (4-10) and scored on Donald's hit.

Peavy, who will become a free agent unless the White Sox pick up his $22 million option, was outstanding for eight innings as he only allowed two men to reach base.

But in search of his fifth complete game of the season, the product of a July 31, 2009 four-for-one trade with the San Diego Padres couldn't hold a two-run lead given to him in the top of the ninth.

"You want to finish what you start," Peavy said. "I felt good. There was no reason for me not to go back out. I felt fine. I didn't have any really stressful innings. … Just once again, it wasn't meant to be. It's just a lot of positives from this year, but just didn't catch a whole lot of breaks."

Pinch-hitter Michael Brantley opened the ninth inning with a single off Peavy and Hafner launched one off the right-field foul pole to tie the game at 3.

Shin-Soo Choo accounted for Cleveland's only other run off Peavy with a long solo homer in the fourth inning to put the Indians up 1-0.

Peavy otherwise set down the side in order in six innings and faced the minimum in seven of the first eight. Peavy's pitch count was 104 after eight innings. He then saw a potential victory disappear over his final five pitches.

Peavy allowed three runs and three hits and struck out eight in eight innings.