Brandon Moss finished a triple shy of the cycle and the Oakland Athletics completed a three-game sweep of the Boston Red Sox with a 3-2 win on Wednesday.

Jemile Weeks singled home the go-ahead run in the seventh inning after Coco Crisp led off with a triple.

The A's won their fourth straight game, sweeping Boston for the first time since May 23-25, 2008. They spoiled an historic day for Red Sox designated hitter David Ortiz, who hit his 400th career home run.

"We were opportunistic when we needed to be," said A's manager Bob Melvin.

Moss was 3-for-4 with a solo homer and two runs scored while reliever Grant Balfour (2-2) worked 1 2/3 perfect innings for the win. A.J. Griffin got his third straight no-decision in three MLB starts after striking out three and giving up two runs -- one earned -- in six innings.

Aaron Cook (2-2) was charged with three runs on nine hits in six-plus innings to take the loss, snapping a two-start winning streak since he came off the disabled list.

"He did what he had to do to give us a victory here," Boston manager Bobby Valentine said. "A couple of balls were hit in the air and hurt him a little. He got a lot of ground balls. He was efficient with his pitching and got us in the dugout quick. We didn't help out a lot with the runs."

Moss worked a 2-2 count before knocking his 10th homer of the season over the center field wall leading off the second inning for a 1-0 lead.

Ortiz tied the game with his milestone shot, becoming the 49th player with 400 homers after a leadoff blast to right in the fourth that was his 22nd of the season.

Ortiz scored a go-ahead run in the sixth after drawing a two-out walk. He went to second when Jarrod Saltalamacchia reached on an error by the second baseman Weeks and scored on Adrian Gonzalez's single to make it 2-1.

But Moss doubled with one out in the sixth when no one could find his pop-up in shallow left and scored on Brandon Inge's double to tie the game.

Crisp chased Cook with a leadoff triple in the seventh and scored when Weeks greeted Andrew Miller with a single, giving Oakland its 3-2 edge.

Moss flied out in the eighth, missing a chance for the cycle, and Ryan Cook pitched a 1-2-3 ninth for his eighth save of the season.

Game Notes

The A's are 5-1 against the Red Sox this season, winning the last five. They remain home to wrap up a six-game stand with three against Seattle beginning Friday...Griffin, who was called up June 24, has a 1.50 ERA in his first three MLB starts...Mauro Gomez, recalled Tuesday for his second stint with Boston, doubled in the second inning for his first major league hit...The Red Sox went 2-5 on a seven-game road trip and head back home for four against the Yankees starting Friday. They selected Justin Germano from Triple-A Pawtucket on Wednesday and optioned fellow righty Clayton Mortensen to the minor league club. Germano, 29, was signed as a minor league free agent in January and went 9-4 in 17 games for Pawtucket, including 16 starts.