TORONTO -- Jhonny Peralta provided all the offence with two home runs and Doug Fister pitched eight strong innings Sunday as the Detroit Tigers defeated the Toronto Blue Jays 4-1 to avoid a sweep.

Peralta hit a three-run homer in the second inning against Toronto left-hander Brett Cecil and hit a solo shot in the ninth against Joel Carreno. The victory snapped Detroit's three-game losing streak, with the last two coming in Toronto, and ended the Blue Jays' three-game surge.

Toronto finished the six-game homestand at 3-3 and now travel to Seattle, Oakland and Tampa Bay for 10 games that might go a long way to deciding whether the Blue Jays will contend for a wild card spot in the American League.

Fister (5-7) held the Blue Jays to seven hits, two walks and one run to win for the fourth time in his past five starts. He also struck out nine, one short of his season high.

Cecil (2-4) allowed four hits, four walks and three runs while striking out seven in 6 2-3 innings.

Jose Valverde pitched the ninth to pick up his 20th save of the season for Detroit.

The Blue Jays (51-50) scored a run in the first inning after leadoff hitter Rajai Davis walked. He swiped second, his 28th stolen base of the season, continued to third on catcher Gerald Laird's throwing error and scored on a groundout by Colby Rasmus.

The Tigers (54-48) struck back in the second with the three-run homer by Peralta. Delmon Young led off with a walk and took third on a double by Ryan Raburn. That set up Peralta's seventh home run of the season, a drive to left on a 3-2 curveball.

It was the ninth home run allowed by Cecil in his eight starts since being recalled from the minors.

The Blue Jays had their chances to get back in the game. They had two runners on base with two outs in third, fourth and fifth innings but could not come up with a clutch hit.

Carreno had retired the Tigers down in order in the eighth and had two out in the ninth before surrendering Peralta's eighth homer of the season. It was the first multi-homer game of the season for the shortstop and the seventh of his career.

Toronto catcher Jeff Mathis had an eight-game hit streak end, while third baseman Brett Lawrie saw his end at seven.