NEW YORK >> David Ortiz went wild and got ejected after being called out on strikes with the bases loaded in the ninth inning, then Yankees closer Andrew Miller fanned Hanley Ramirez to preserve New York's 3-2 win over the Boston Red Sox on Friday night.

Aaron Hicks hit a tiebreaking home run off Rick Porcello (5-1) leading off the seventh inning.

The game turned tense and testy in the ninth. The Red Sox loaded the bases with three singles off Miller, bringing up Ortiz, who had homered earlier.

Ortiz took a 3-1 breaking ball that catcher Brian McCann awkwardly gloved, and plate umpire Ron Kulpa called it a strike. Big Papi argued and manager John Farrell quickly came from the dugout to protect his slugger and got tossed.

Ortiz then took a called third strike, went to the dugout and slammed down his equipment. He got ejected, too, and stormed back the plate as teammates rushed to restrain him.

Miller fanned Ramirez to finish off a four-out save, his sixth save this season.

Kirby Yates (1-0) wound up with the win.

Last-place New York, off to its worst start in a quarter-century, put pitcher CC Sabathia on the disabled list before the game because of a groin strain, then lost center fielder Jacoby Ellsbury to a hip injury in the first inning. Earlier in the week, Yankees designated hitter Alex Rodriguez went on the DL because of a hamstring injury.


But Hicks gave the Yankees something to cheer about. Acquired from Minnesota during the offseason, he was hitting .088 with no extra-base hits and two RBIs in 34 at-bats when he sent a hanging changeup into the right-field seats.

As he circled the bases, the Yankees used the strobe function of their new LED lights, which had previously been used only during soccer games.

New York had lost seven of its previous eight games. At 10-17 the Yankees are off to their worst start since 1991.

To hold the lead, Yankees manager Joe Girardi used Dellin Betances for a third straight day for the first time in the reliever's big league career. After Travis Shaw's infield hit in the eighth, Girardi brought in Miller.

Pinch-hitter Josh Rutledge reached on an infield hit leading off the ninth, just beating the throw by second baseman Starlin Castro. After Mookie Betts took a called third strike, Dustin Pedroia singled and Xander Bogaerts reached on a pop to short center that glanced off the glove of sliding shortstop Didi Gregorius for a single.

That brought up Ortiz, setting off a wild sequence.

Ortiz hit a two-run homer in the first off Michael Pineda. Ortiz has hit 452nd of his 510 home runs for Boston, tied with Carl Yastrzemski for second among Red Sox behind Ted Williams (521), and has hit 50 homers against the Yankees.

Porcello, who had been trying to join Jake Arrieta and Chris Sale at 6-0, allowed three runs and six hits in seven innings.

When Betts doubled in the first, the Yankees shifted against Ortiz and Betts strolled to third with a steal when the base was left uncovered. Ortiz then lined a 1-2 slider into the right-field seats for his seventh home run this season, prompting a trip to the mound by pitching coach Larry Rothschild after just 15 pitches.

New York scored in the bottom half after Ellsbury walked and stole second and third. But he got hurt while taking third on the 50-degree, rainy night, walked home gingerly on Brian McCann's double, and the Yankees said he will have an MRI.

Boston loaded the bases on three singles in the sixth, two that the wind knocked down in front of Hicks, who moved to center when Ellsbury left the game. Pineda waved his arms in frustration, then got Jackie Bradley Jr. to hit a bouncer right over second for an inning-ending double play.