TORONTO -- Robbie Grossman hit a two-run homer, Jonathan Villar belted a three-run blast and Jason Castro added a solo shot as the Houston Astros avoided a three-game sweep Thursday with a 6-4 win over the Toronto Blue Jays at Rogers Centre.

Colby Rasmus hit a solo homer for the Blue Jays (5-5), who fell back to the .500 mark with the loss. Toronto ace R.A. Dickey (1-2) allowed five earned runs and six hits over seven innings.

Starter Dallas Keuchel (1-1) went seven innings for Houston (4-6), allowing five hits and one earned run. The Blue Jays rallied for three runs in the ninth inning before Anthony Bass got the final out for his first save.

Leadoff man Melky Cabrera opened the Toronto half of the first inning with a double to extend his hitting streak to 10 games. He moved to third on a sacrifice bunt but was left stranded when Jose Bautista popped up and Edwin Encarnacion grounded out.

Dickey retired the side in order in the first inning but gave up a pair of two-out walks in the second. The veteran knuckleballer got Grossman on a groundout to escape unscathed.

Castro led off the fourth inning with a sharp single to centre field for the Astros' first hit of the game. He was forced out at second base when Jose Altuve hit into a fielder's choice.

Dickey caught Altuve leaning towards second base on a leadoff and picked him off for the second out. He struck out Chris Carter for the third out.

Marc Krauss led off the fifth with a double off the wall in right-centre field and moved to third when Matt Dominguez grounded out to first base. Grossman turned on a 3-0 pitch for his first homer of the season.

Dominguez made a stellar defensive play in the fifth inning to rob Brett Lawrie of Langley, B.C., of a sure hit. The Houston third baseman dived to his left and threw from his knees to get the speedy Canadian by a half-step.

Rasmus followed with a solo homer that hit the facing of the second level in right-centre field. It was his first home run of the season.

Blue Jays manager John Gibbons challenged a call later in the inning when Cabrera was called out at first base. Cabrera stumbled out of the batter's box and Dominguez bobbled the ball at third base before recovering to fire a throw that was barely in time at first.

The umpires reviewed the play and the original call stood to end the inning.

In the seventh, Dominguez hit a one-out double and Grossman walked. After a visit to the mound by pitching coach Pete Walker, Villar crushed Dickey's first pitch to deep centre for his second homer of the season.

Dickey allowed three walks and had four strikeouts.

Esmil Rogers came on in relief to start the eighth inning and gave up the solo homer to Castro. It was the second homer of the season for the Houston catcher.

Astros reliever Josh Fields gave up two runs in the ninth when pinch-hitter Adam Lind doubled to the gap in left-centre field. Lind scored when Bass made a throwing error to first.

That brought Maicer Izturis to the plate with the potential tying run but he hit a comebacker to end the game.