BOSTON -- No one had to tell manager Bo Porter that his team had just done something the Houston Astros had never done before.

They won a game at Fenway Park.

"I'm very aware of it -- we talked about it in our pre-game (meeting)," Porter said after a crazy ending gave the Astros a 5-3, 10-inning victory over the Boston Red Sox on Friday night. It was the first win at Fenway in nine games for the franchise that just joined the American League last season.

Porter was aware of another thing after the win -- that the Astros matched last year's win total with No. 51.

"It's a huge credit to the players in that locker room, to our staff; they worked extremely hard and we still have six weeks to go in the season," Porter said. "Let's continue to try to accomplish the goal in which we set out, to be the most improved team in baseball as far as the won-loss column goes."

The Astros, who tied the score on a bizarre base-running play in the eighth inning, got a pop-fly, two-out, two-run double from rookie right fielder Jake Marisnick for the win.

The Marisnick hit won the game, but the real story came in the eighth inning, a play that had Astros personnel roaring in the clubhouse as they watched replays.

With two outs and two on, third baseman Matt Dominguez hit a grounder to short. Xander Bogaerts' flip to second baseman Dustin Pedroia was a hair late. Pinch-runner Gregorio Petit rounded third and was caught short of home. He stopped, eluded catcher Christian Vazquez, who had taken a step toward the mound to avoid the bat lying on the ground, and then scored as reliever Burke Badenhop dropped the ball at the plate.

"I just planned it like that, yes sir," a laughing Petit said later.

Petit said he thought the ball was in the outfield when third base coach Pat Listach told him to go home. He knew he was dead, so he decided to take his chances in the rundown.

The Red Sox challenged both calls; both were confirmed.

Boston manager John Farrell called it "a strange play" and said "this was not a mental error on (Vazquez's) part, by any means."

The Astros, winning for second time in six games, loaded the bases with nobody out in the 10th on two hits and a hit batter against loser Craig Breslow (2-4).

Breslow got an out and so did right-hander Junichi Tazawa, but Marisnick came through with his second hit of the night -- good for his fourth and fifth RBIs in 14 games with Houston.

"You can't defend a bloop double on the line," said Farrell.

Left-hander Tony Sipp (3-2) worked the final 1 1/3 innings for the win.

The loss ended Boston's four-game winning streak and also extended the Curse of Ben Affleck's birthday -- the Red Sox losing for the 15th straight time on the Hollywood star's big day. He's a huge fan who grew up in nearby Cambridge.

Boston right-hander Clay Buchholz failed to hold a 2-0 lead and gave up a tying homer in the seventh to left fielder Robbie Grossman. It was the third hit of the night for Grossman, who hit his sixth homer of the season after driving in his team's first run.

The Red Sox then went ahead again on an RBI single by right fielder Brock Holt off Dallas Keuchel in the bottom of the inning.

Buchholz, who pitched a three-hit shutout against the Astros in Houston on July 13, left after seven innings but failed to get a win for his fifth straight start.

Left fielder Yoenis Cespedes gave the Red Sox a 2-0 lead in the fourth inning with his 20th homer of the season, his third in the last five games and his first in 10 career games at Fenway.

Pedroia, who fouled a ball of his foot earlier in the game, left later because of the injury. He will be further evaluated on Saturday.

Talking about his team's 51st win, Keuchel said, "It's nice, but we're not done. We know that we've come a long way since last year, from how miserable it was day in and day out. Coming from spring training everybody kind of got together and said, 'Hey listen, let's inch our way closer to being .500 and being a legit playoff contender' and I think we're heading in the right direction."

NOTES: The Astros recalled LHP Kevin Chapman and optioned OF L.J. Hoes to Triple-A. ... The Red Sox signed eight international free agents, including two of the top three pitchers rated for the international signing period -- RHPs Anderson Espinoza (No. 1) and Christopher Acosta (No. 3). ... Houston RHP Brad Peacock, making his second start since being recalled from the minors Aug. 6, pitches against RHP Rubby De La Rosa in Game 3 of the series Saturday night. ... ... Boston C David Ross (plantar tendon) took batting practice and also worked in shin guards on the field before the game as he nears a minor-league rehab assignment.