TORONTO — Justin Smoak tied the game with a two-run homer in the ninth, and Kendrys Morales followed with a solo shot as the Toronto Blue Jays rallied for a 3-2 walkoff win over the Oakland Athletics on Wednesday.

Josh Donaldson started the rally with a leadoff walk off Santiago Casilla (2-5). Casilla then allowed the back-to-back homers, spoiling a stellar start from Oakland's rookie right-hander Paul Blackburn.

It was the sixth time this season the Blue Jays had hit back-to-back homers. They improved to 47-54 with their third straight win and can sweep the four-game series with a victory Thursday afternoon.

Marco Estrada, in what could be his last outing as a Blue Jay, failed to earn a win for the 10th straight start despite a strong pitching performance.

The pending free agent, who could be moved before next Monday's non-waiver trade deadline, pitched five full innings for the first time since June 24 (a string of five starts), allowing only two runs and three hits while walking four and striking out four.

Estrada came into the game with losses in five straight decisions for the first time since 2012. He had never lost six straight.

Marcus Semien homered for the Athletics (44-57).

Blackburn, in just his fifth major league start, allowed two hits, walked three and struck out three over a clinical 98-pitch no-decision.

Toronto didn't get its second hit off Blackburn until the sixth inning — a two-out double from Donaldson on the rookie's 82nd pitch of the game. The double was met with loud, enthusiastic cheers from the 41,984 in attendance who clearly hadn't given up hope, but the crowd quieted considerably as Smoak lined out to shortstop to end the inning.

Estrada looked to have run into trouble early, walking back-to-back batters with one out in the first inning and allowing a two-out single to load the bases. He got out of the jam with a Ryon Healy pop up, then retired seven straight batters before a one-out double to Yonder Alonso in the fourth.

The game turned for Estrada in the fifth as he walked Matt Joyce before allowing Semien's two-run homer to left-field for a 2-0 Oakland lead. He walked the next batter, then got a strikeout to end the inning and his night.

Toronto had a chance to take a lead in the first when Jose Bautista led off with a double and Smoak walked with one out. But Morales grounded into a double play to end the frame.

NOTES: Toronto closes out the four-game home series against the A's with an afternoon game Thursday. Right-hander Marcus Stroman (9-5, 2.98 earned-run average) will start for the Blue Jays. Oakland counters with lefty Sean Manaea (8-5, 3.82 ERA).