TORONTO — Aaron Sanchez had to learn to be patient with himself as he struggled through most of this season.

Tuesday's game helped the Blue Jays right-hander believe he's on the right course, even if he didn't get the win for it.

Saddled with the no-decision in Toronto's 2-1 walk-off victory over the Cleveland Indians, Sanchez was pleased with a five-inning performance that saw him allow just one run and no walks for the first time all season.

"I think just finally having my feet underneath me, really," said Sanchez, who missed significant stretches of the 2017 and 2018 seasons with injuries. "For so long there, dating back to 2017 when the finger issues started, I altered so many things just to get 60 feet six inches and you create a lot of bad habits doing that.

"Sometimes it's harder to knock the bad habit then to kind of start from fresh. So for me it's just knocking those bad habits, getting back to what feels comfortable with me and what works."

Justin Smoak tied the game on a solo homer in the bottom of the ninth, then drove in Eric Sogard for the winning run in the 10th inning as Toronto (39-64) beat Cleveland for the first time in six meetings between the teams this season.

Smoak's 17th homer of the year came off closer Brad Hand. His game-winning single — a liner that got under third baseman Jose Ramirez's glove — was off Tyler Olson (1-1).

"He's been like that ever since I've played with him here, always time and time again coming up clutch in big situations," Sanchez said of Smoak. "No bigger night tonight to hit one out to tie it and the base hit right there to win it."

Smoak credited his starting pitcher with keeping his team in the game. He also said it seems like Sanchez has turned a corner on his season.

"For him honestly, I think not pitching for a year and a half, almost two years, it's definitely going to take time to get back into the every day grind of his routine," Smoak said. "Honestly I feel over his last few starts he's been a lot better and hopefully he can continue to do that."

The 27-year-old Sanchez did not allow a walk for the first time in 60 games, a streak that was tied for the longest in club history (Brandon Morrow also went 60 straight games with at least a walk from 2010-2012). He also struck out six batters Tuesday, the most since a season-high 11 strikeouts against the White Sox in May.

Francisco Lindor drove in the lone run for Cleveland (58-42), which opened play three games back of Minnesota for first place in the AL Central.

Trevor Bauer, who's been increasingly mentioned in trade rumours as the July 31 deadline approaches, allowed just three hits while striking out nine over 7 2/3 innings. He threw 107 pitches, 68 for strikes.

The Blue Jays didn't get their first hit until Vladimir Guerrero Jr. led off the fifth inning with a double.

Bauer said he was feeling ill after the game but felt fine during it.

"I thought he was terrific," Cleveland manager Terry Francona said. "He gave everything he had. He always does."

Ken Giles (2-2) picked up the win for Toronto.

Lindor put Cleveland on the board in the third inning with a single that deflected into the outfield off Toronto second baseman Cavan Biggio, scoring Greg Allen for a 1-0 lead.

The Blue Jays had a chance to tie the game in the eighth but a base-running miscue cost them. Teoscar Hernandez, who led off with a single and advanced to second on a wild pitch, rounded third aggressively on a pinch-hit single from Lourdes Gurriel Jr. and was tagged out while sliding into home plate.

NOTES: The game was exclusively broadcast live on MLB's official YouTube channel. It was the first of a 13-game package that will be streamed on YouTube this season. ... Attendance was 22,186. ... The teams close out the three-game series Wednesday. Marcus Stroman will start for the Blue Jays while Cleveland counters with Shane Bieber.