Andrew Miller had a chance to seal the New York Yankees' sweep by retiring the bottom of the Red Sox order.
A pair of walks and a fielding error later, he was facing Boston slugger David Ortiz with two outs and the bases loaded while protecting a three-run lead.
"The hitter he had to get out who has so many times beat the Yankees and has had big hits for them," Yankees manager Joe Girardi said on Sunday night. "It shows he has the stomach for it."
Miller got Ortiz on a hard line drive right to center, and the Yankees completed the three-game sweep of the rival Red Sox with an 8-5 victory. It was New York's first sweep of a Red Sox series three games or longer since a five-game sweep in 2006.
"There's still a long way to go, but you can't feel any better than that," said Miller, who saw Ortiz win plenty of games as a Boston teammate from 2011-14. "He's got a flare for the dramatic. That's been the most important part of his career. It's not how I drew it up and wanted to do it."
Jacoby Ellsbury had four hits and was also hit by a pitch and walked to reach base a career-high six times. Mark Teixeira and Brett Gardner homered for the Yankees, who have won 13 of 16 games since starting the season 3-6.
Adam Warren (2-1) took a one-hit shutout into the sixth inning, allowing four runs in 5 2-3 innings. New York opened an 8-0 lead and then held on after Boston scored five runs and brought the tying run to the plate in the sixth.
The Red Sox didn't really threaten again until the ninth. It was still 8-5 when Miller came in, striking out two and walking two before third baseman Chase Headley struggled to field Dustin Pedroia's grounder, loading the bases. Ortiz fell behind 0-2 before hitting a 2-2 pitch hard, but right at Ellsbury.
"I think we showed tremendous fight, tremendous comeback," Red Sox manager John Farrell said, "right down to the final swing of the night."
The Red Sox lost for the eighth time in 11 games to fall below .500 for the first time this season. Mike Napoli hit a three-run homer in the sixth, the only inning Boston scored.
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 a one-hit shutout with two out in the sixth. But he gave up a single to Pedroia and an RBI double to Ortiz before hitting Hanley Ramirez with 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.