BOSTON (AP) - Alex Rodriguez got hit by a fastball from Boston starter Ryan Dempster in the second inning Sunday night, setting off an angry scene at Fenway Park and leading to the ejection of New York Yankees manager Joe Girardi.

A-Rod answered with his bat four innings later by hitting his 649th career home run, prompting even more boos and derisive chants. The solo shot began a four-run, go-ahead inning that sparked the Yankees to a 9-6 win over the Red Sox.

The game between the longtime rivals quickly turned testy, with the benches and bullpens clearing in the second and the teams being warned about beanballs by plate umpire Brian O’Nora.

Dempster appeared to take aim at Rodriguez, recently suspended for 211 games by Major League Baseball in the Biogenesis drug case. Rodriguez appealed the penalty and can play until there is a final decision.

Booed when he was on deck at the end of the first inning, Rodriguez was jeered when he led off the second. Fans chanted “You’re a cheater!” as Dempster threw his first pitch behind Rodriguez’s knees.

Dempster missed inside with the next two pitches and then threw a fastball that hit A-Rod’s elbow pad and deflected into his back.

O’Nora immediately issued an emphatic warning to both benches, and a trainer escorted Rodriguez to first base. Rodriguez stared at Dempster, but made no move toward the mound.

Girardi, however, ran onto the field and began hollering at O’Nora. Presumably in disbelief that Dempster hadn’t been ejected, a livid Girardi wildly swung his fist _ and it came near O’Nora’s chin.

“He was trying to establish his fastball,” Red Sox manager John Farrell said during an in-game interview on ESPN. “Obviously, the pitch got away from him.

“We didn’t feel in our dugout it was anything intentional,” he added.

Dempster had hit four batters in 140 innings this season going into the game. He plunked two last year.

Tension already was high this weekend with the Red Sox leading the AL East and the Yankees scrambling for a playoff spot. This dustup at Fenway certainly looked familiar _ Boston pitcher Pedro Martinez threw down New York coach Don Zimmer during a wild brawl in the 2003 AL championship series, and Red Sox catcher Jason Varitek pushed Rodriguez in the face during a 2004 scuffle.

But this confrontation came with a decided twist: Along with the Red Sox, Rodriguez has been at odds with the Yankees, too.

Yankees management has been feuding with Rodriguez and his legal team, with the club still owing him more than $80 million through 2017.

“It’s hard to engage someone when this stuff is going on,” general manager Brian Cashman said hours before Sunday’s game, explaining why he and Rodriguez don’t talk much anymore.

After the game, Rodriguez said he had started the process of filing a grievance against the Yankees and that it’s the responsibility of the players’ union to file it formally.

Asked if it’s difficult to play for a team he’s at odds with, Rodriguez said, “it’s just important for me to focus on the team and helping the team win. It is a very challenging situation.”

Other major leaguers also have spoken out, criticizing players penalized for using performance-enhancing drugs for the damage they’ve done to baseball. Boston pitcher John Lackey recently said he had a problem with Rodriguez being allowed to play while his suspension is under appeal.

Girardi said O’Nora should have issued a warning to Dempster after the first pitch to Rodriguez and Dempster should have been ejected.

“You have to have your head in the sand with the comments that came from the other side not to know that something might be up,” Girardi said. “I thought it was handled very poorly.”

Before the game, Cashman specifically took issue with Rodriguez and his new lawyer, defending the team’s medical treatment of the star third baseman during last year’s playoffs.

Over the weekend, lawyer Joseph Tacopina told The New York Times that the Yankees tried to make Rodriguez look bad, claiming they used him in the playoffs while he was hurt. The three-time AL MVP went 3 for 25 with 12 strikeouts in the 2012 postseason.

“I know that our medical staff did everything they possibly can to assist Alex, help Alex, diagnose Alex and give him the best proper medical care,” Cashman said.

Cashman said Rodriguez never complained of any problem during the playoffs until Girardi pulled him for a pinch-hitter in a key spot.

This weekend, Rodriguez said: “I shouldn’t have been out there last year.”

Cashman disputed that stance. He didn’t like how the message was delivered, either.

“Did he ever say he didn’t feel right? He never said it,” the GM said.

“You see the attorney say what he said and Alex is talking to you guys after the game and it seems like when I’m reading the comments, it’s like, `I can’t really comment.’ It’s as if he doesn’t know anything about it, which we all know he really does,” Cashman said.

Rodriguez said he hoped he could reconcile with team management.

“I’d rather have the lawyers doing all the talking and I’m going to do all the playing,” he said.

Sidelined by a hip injury and quadriceps problem, the 38-year-old Rodriguez made his season debut Aug. 5 on the same day MLB handed down his suspension.

Rodriguez was hitting .279 with one homer and four RBIs going into Sunday’s game. After being hit by a pitch, he drove in a run with groundout in his next at-bat.

In the sixth, Rodriguez hit a leadoff drive to straightaway center field against Dempster and let out a scream as he rounded both first base and third. The three-time MVP clapped his hands as he stepped on home plate and pointed to sky.

The home run trimmed the Yankees’ deficit to 6-4, and they went ahead later in the inning when Brett Gardner hit a bases-loaded triple.

Rodriguez’s second homer since coming off the disabled list left him 11 behind Willie Mays for fourth place on the career list.