Updated

After a weekend of heckling from Blue Jays fans, Hunter Pence came up with the perfect retort.

Pence hit a two-run homer, Wandy Rodriguez pitched six solid innings and the Houston Astros held off Toronto 3-2 on Sunday to win a series for the first time in three weeks.

Even though the Astros had never played in Toronto before, Pence found himself the target of fans in the right-field seats.

"I've never had it like that," Pence said. "I just thought that's how Canadians might be. They like to heckle."

His fifth-inning drive wasn't enough to end the insults, but Pence didn't mind.

"They actually got louder," he said. "That's when you know you're doing good. The louder they get, the better you're doing."

In his experience with leather-lunged fans, Pence said only those in the Wrigley Field bleachers compare to Toronto's taunters.

"It's similar to Wrigley, but in Wrigley there's so many yelling, it's almost like you can't totally pick them out," Pence said. "These guys had a knack for being loud alone, or all chanting together. It was pretty aggressive."

Houston, which had lost 11 of 14 coming in, won its first series since taking two of three from Milwaukee between April 29 and May 1.

"It's been a while when you can't remember," said reliever Mark Melancon, who got through a nervous ninth to earn his third save.

The Astros had not won an interleague series since taking two of three from Detroit in June 2009.

"Tough series. You can say all you want, a swing or a pitch away from sweeping the series — the fact remains it is what it is," Toronto manager John Farrell said.

Rodriguez (3-3) struggled during interleague play last season, losing all three of his starts while posting a 10.93 ERA. But the left-hander, coming off eight shutout innings against Atlanta in his last start, followed that up by allowing two runs and six hits. He walked two and struck out six.

"He worked through some stuff early in the game and then he did real well in the fourth, fifth and sixth," Astros manager Brad Mills said. "He continues to throw the ball extremely well."

Houston has won four of the past five games Rodriguez has started.

Wilton Lopez pitched 1 1-3 innings and Melancon got five outs.

Juan Rivera and J.P. Arencibia homered off Rodriguez, but it wasn't enough for the Blue Jays, who left the bases loaded in the ninth.

Yunel Escobar reached on an infield single with two outs and was replaced by pinch-runner Mike McCoy. Corey Patterson followed with a double and Jose Bautista was intentionally walked, loading the bases for Aaron Hill, who ended it by grounding to third on the second pitch.

"It seems like the meat of the order always comes around in those situations," Mills said. "It always does."

Watching from the clubhouse, Rodriguez was a bundle of nerves, but Melancon had no trouble keeping his cool, getting Hill to bounce a cutter into the turf.

"We weren't going to get beat on a pitch that was his pitch," Melancon said. "We were going to go right after him but be smart with what we threw."

Houston opened the scoring in the third on a two-out RBI single by former Blue Jays farmhand Brett Wallace. Toronto tied it in the bottom half when Rivera homered into the second deck in left, his fourth.

The Astros took the lead in the fifth against right-hander Kyle Drabek. Angel Sanchez hit a one-out single and Pence followed with a two-run drive to left-center, his sixth.

For Pence, the homer was his first since May 9, when he hit a solo shot in a 6-1 loss to Cincinnati.

Drabek (3-3) lost for the third time in five starts. The rookie allowed three runs and eight hits in six innings, walked three and struck out three.

Arencibia homered on Rodriguez's first pitch of the sixth, his eighth of the season and second in three games. But it wasn't enough to beat the last-place Astros.

"When they were coming in people were saying, 'Worst record in baseball.' That's not the way it works. You've got to go out there and take every opponent seriously. They did a good job pitching themselves and had some timely hitting," Arencibia said.

NOTES: Houston catcher J.R. Towles went 0 for 4, extending his slump to a career-worst 0 for 32. ... The Astros are 5-1 all-time against the Blue Jays. ... Toronto's Edwin Encarnacion returned to the lineup after sitting out the past three games. Encarnacion, who made two errors at first base in his last appearance, started at DH. ... Drabek's father, Doug, spent four seasons with Houston during his 13-year career. ... The Blue Jays optioned McCoy to Triple-A Las Vegas after the game and recalled LHP Luis Perez. ... Toronto INF John McDonald (personal reasons) was away from the team. He is scheduled to rejoin the Blue Jays in New York on Monday.