BOSTON — Jacoby Ellsbury had four hits, and Adam Warren took a one-hit shutout into the sixth inning on Sunday night to lead the New York Yankees to an 8-5 victory over the Boston Red Sox.

It was the first time the Yankees swept the Red Sox in a series of three games or more since a five-game sweep in 2006.

Ellsbury was also hit by a pitch and walked, reaching base a career-high six times. Mark Teixeira and Brett Gardner homered for the Yankees, who led 8-0 and then held on for their 13th win in 16 games.

Warren (2-1) allowed four runs in 52/3 innings. Andrew Miller walked the bases loaded in the ninth but struck out two and got David Ortiz on a line drive to center for his 10th save.

Mike Napoli hit a three-run homer for Boston, which lost for the eighth time in 11 games and fell below .500 for the first time this season.

New York opened an 8-0 lead, then held on after Boston scored five runs and brought the tying run to the plate in the sixth.

Teixeira’s two-run homer gave New York the lead in the first. The Yankees made it 5-0 against Joe Kelly (1-1) in the third on back-to-back doubles by Brian McCann and Carlos Beltran. And they took an 8-0 lead in the sixth on Gardner’s three-run homer.

Warren, who didn’t allow his first hit until Mookie Betts doubled to lead off the fourth, still had given up only one hit when Dustin Pedroia singled with two outs in the sixth. Pedroia scored on a double by David Ortiz before Hanley Ramirez was hit by a pitch. Pablo Sandoval followed with an RBI single to left.

Esmil Rogers relieved Warren and Napoli hit his second pitch into the first row of the Monster Seats. Daniel Nava walked and Xander Bogaerts singled before Blake Swihart, who made his major-league debut on Saturday, struck out to end the inning.

UP NEXT

YANKEES: Chase Whitley (1-0) makes his second start of the season when the Yankees open a three-game series in Toronto. R.A. Dickey (0-3) pitches for the Blue Jays.

RED SOX: Clay Buchholz (1-3) will pitch the opener of a three-game series at home against Tampa Bay. Jake Odorizzi (2-2) will pitch for the Rays.

TRAINER’S ROOM

YANKEES: Infielder Brendan Ryan reinjured his hamstring while running in Florida during a rehab assignment. He is expected to rest for at least a week.

RED SOX: Luis Jimenez was claimed off waivers from Milwaukee, and catcher Ryan Hanigan was transferred from the 15-day DL to the 60-day DL. He underwent surgery Saturday for a fractured pinkie on his right hand.