Red Sox pitcher Matt Barnes was ejected in the eighth inning of Boston's 6-2 victory Sunday at Camden Yards when his pitch sailed past the head of Baltimore Orioles third baseman Manny Machado.

Machado had spiked Red Sox second baseman Dustin Pedroia on Friday night sliding into second base. Machado apologized with a text message on Friday night, but that evidently wasn't the end of it.

"That's on them,'' Machado said after Sunday's game. "Whatever happened today, I'm going to keep [being] me.''

When Machado batted in the sixth inning, Eduardo Rodriguez threw three pitches down and in near the knees. Machado came up again in the eighth, and Barnes' pitch whizzed behind Machado and hit his bat. The ball hit Machado and rolled foul, and plate umpire Andy Fletcher tossed Barnes.

"I would never intentionally throw at someone's head. That's kind of a line you don't cross,'' Barnes said.

Boston manager John Farrell immediately bolted from the dugout to complain. Farrell on Saturday called the league office to discuss about what he called "an illegal slide'' by Machado.

"He was trying to take a four-seamer in and above his hands and the pitch got away from him,'' Farrell said.

But Orioles first baseman Chris Davis thought the fastball was intentionally directed at Machado's head.

"I think it was completely obvious,'' Davis said. "I haven't seen a guy miss that bad in a while -- behind a guy's head.''

Matt Barnes' high, very inside pitch behind the head of Manny Machado Sunday came two days after the Orioles star took out Red Sox second baseman Dustin Pedroia with a spikes-high slide. AP Photo/Gail Burton

Orioles manager Buck Showalter appeared reluctant to criticize the Red Sox, but said, "The courage it takes not to retaliate a lot of times in life is a lot more challenging than doing what ended up happening today.''

During Farrell's argument with Fletcher, Pedroia was standing on the top step in the dugout and whistled to catch Machado's attention. He mouthed the words, "It's not me,'' evidently trying to show he was not seeking revenge. Machado acknowledged Pedroia and later pointed to his head.

"I had nothing to do with that. That's not how you do that, man,'' Pedroia said afterward. "I'm sorry to him and his team. If you're going to protect guys, you do it the right away.''

He added: "It's definitely a mishandled situation. There was zero intention of him trying to hurt me [Friday night]. He just made a bad slide. He did hurt me. It's baseball, man."

Orioles All-Star closer Zach Britton took issue with Pedroia's apparent in-game apology to Machado, describing Pedroia's "it's not me" message regarding Barnes's decision as "even more frustrating."

"Because he's the leader of that clubhouse and if he can't control his own teammates, then there's a bigger issue over there," Britton told BaltimoreBaseball.com after being told about Pedroia's eighth-inning exchange with Machado.

Machado grabbed a bat and waited for Red Sox reliever Joe Kelly to get warmed up before stepping back into the box with an 0-1 count.

On the first pitch from Kelly, Machado drove a double to center field that scored Adam Jones and cut Boston's lead to 6-1.

Machado ended up making the last out of the game, hitting a popup on a pitch from Craig Kimbrel, who got his seventh save.

Pedroia was out of the lineup for a second consecutive game Sunday after being taken out by the hard, spikes-high slide by Machado in the eighth inning Friday night. Pedroia continued to experience swelling in his left ankle and surgically repaired left knee and will undergo an MRI exam Monday after the Red Sox return home.

"I love Manny Machado," Pedroia said Sunday. "I love playing against him. I love watching him. If I slid into third base and got Manny's knee, I know I'm going to get drilled. It's baseball. I get drilled, I go to first base. That's it."

The test will be administered "just to rule anything out," Farrell told reporters before Sunday's series finale.

The Associated Press contributed to this report.