NEW YORK (AP) 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.

More from FoxSports

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.