TORONTO -- Dustin Pedroia's 11th inning ground-rule double helped the Boston Red Sox beat the Toronto Blue Jays 5-3 on Sunday.

The Red Sox (30-20) avoided the series sweep with the win and snapped a three-game losing skid. Toronto (26-26) saw its four game win streak ended in the loss.

Pedroia scored Blake Swihart from third for the go-ahead run with runners on the corner. Xander Bogaerts followed it up with a ground out to second that scored Mookie Betts.

Clay Buchholz (3-5), who was making his first relief appearance since Aug. 17, 2008, which also came against the Blue Jays, pitched a scoreless inning for the win. Koji Uehara picked up his first save of the season.

Gavin Floyd (2-4) surrendered two earned runs in a third of an inning for the loss.

Toronto erased a 3-2 deficit on Edwin Encarnacion's 11th home run of the season in the eighth inning. The designated hitter took Heath Hembree's 1-0 pitch to the second deck in left field tying the game 3-3.

Jose Bautista got the Blue Jays on the board in the fifth when he hit a two-run home run off David Price that smacked the top of the foul pole in left field. It was Bautista's sixth career home run off Price -- the most Price has allowed to any opposing hitter.

Price, who made his first start in Toronto since signing with the Red Sox in the off-season, went 6 1/3 innings allowing two earned runs on five hits while striking out three and walking three.

R.A. Dickey tossed 5 1/3 innings of no-hit ball before the Red Sox bats got to him in the sixth.

With the Red Sox trailing 2-0, Betts got Boston's first hit of the afternoon with a one-out triple to right. Pedroia followed it up with a single, scoring the Red Sox right fielder.

Bogaerts then extended his hit streak to 22 games with a single to left. After Travis Shaw walked to load the bases, Dickey hit Hanley Ramirez scoring Pedroia from third to tie the game 2-2.

Chad Girodo took over from Dickey and walked Jackie Bradley Jr., which scored Pedroia -- the go-ahead run. Jesse Chavez relieved Girodo and retired both Josh Rutledge and Christian Vazquez to limit the damage.

Dickey allowed three earned runs over 5 1/3 innings while walking four and striking out one.