BOSTON (AP) Xander Bogaerts loves watching from the on-deck circle and learning what J.D. Martinez does at the plate.

Bogaerts' start this season has been quite impressive, too.

The Red Sox shortstop hit a three-run homer, Martinez added a two-run shot and Boston avoided its first series sweep this season with a 6-4 victory over the Oakland Athletics on Wednesday night.

"It's pretty impressive what he does when you're behind looking at him," Bogaerts said. "Normally I'm a guy who gets to the on-deck circle a little bit later. I've got to get there early if he swings at the first pitch and gets a hit. He hits some bombs on the first pitch."

Signed as free agent to a $110-million, five-year contract during spring training, Martinez is hitting mainly in the cleanup spot and has a .344 average with 12 homers and 36 RBIs. Bogaerts, who spent some time on the disabled list with an injured left ankle, is batting .306 with five homers and 21 RBIs.

Chris Sale (4-1) gave up just two runs and two hits in five innings, striking out nine and walking four - his most bases on balls since also allowing four on August 31, 2016.

"Four walks, that's not my game," Sale said. "That's not who I am. Obviously, you want to be better than that. Anytime your bullpen throws almost as many innings as you do, that's not what you're looking for."

Craig Kimbrel, the fourth reliever, got the final three outs for his 12th save.

The win also prevented Boston from matching its season-high losing streak of three games.

Marcus Semien hit a two-run homer, and Matt Joyce and Matt Olson each hit a solo shot for the Athletics, who won the first two games and finished the season series by winning four of six.

Trevor Cahill (1-2) gave up three runs to the first four batters he faced, but held the Red Sox scoreless the rest his five innings.

"Had a rough first inning, but recovered well enough to give us five and keep us in the game against a guy that typically you're not going to score a whole lot off of," Oakland manager Bob Melvin said.

Coming off a career high-tying 15-strikeout performance over nine innings in his previous start, Sale struggled with his command on a chilly, misty evening and was lifted after 102 pitches.

Martinez's homer into the center-field seats highlighted a three-run first. Hanley Ramirez had a run-scoring grounder before Martinez's drive into the first section of the bleachers to the right of the Green Monster.

"I wouldn't say I wasn't sharp, but, yeah, the first was rough, but after that you just kind of mix it around," Cahill said.

Bogaerts' homer completely left Fenway Park over the Monster and made it 6-2 in the sixth.

Semien's drive also left Fenway over the Monster.

TRAINER'S ROOM

Athletics: Cahill (right shoulder impingement) was reinstated from the 10-day DL before the game and outfielder Jake Smolinski was optioned to Triple-A Nashville. "When you don't play for an extended period of time, get some at-bats, you don't feel comfortable," Melvin said.

Red Sox: Second baseman Dustin Pedroia (recovering from offseason left knee surgery) is expected to resume his rehab assignment with Triple-A Pawtucket on Friday. With the PawSox rained out Tuesday and a morning game Wednesday, Pedroia was in Boston. Manager Alex Cora said they'd find somewhere for him to play if expected rain comes this weekend. "He needs his repetitions," Cora said. "We'll find innings."

ROAD WOES

Cahill hasn't picked up a win on the road - start or relief - since a victory at Colorado on August 20, 2016, a span of 24 games.

WHAT A CATCH

A's right fielder Stephen Piscotty made a running catch before tumbling headfirst over a short wall down the line. The play was overturned after replay review.

"I felt like I had a good jump on it, I could get there, it was just a matter of figuring out that wall," he said. "I haven't played here much. I kind of got lucky, honestly, sort of threw my glove up there and was able to not get hurt and make the catch."

QUICK START

Boston third baseman Rafael Devers played in his 100th major league game before his 22nd birthday, only one of three Red Sox players to do that in the last 50 years. The others are: Bogaerts and former right fielder Dwight Evans.

UP NEXT

Athletics: RHP Andrew Triggs (3-1, 5.31 ERA) is slated to start the opener of a four-game series on Thursday in Toronto.

Red Sox: LHP David Price (3-4, 4.89) is line to pitch Thursday's opener of a four-game series against Baltimore. The game is a makeup from the Patriots' Day rainout.