PHILADELPHIA -- After a sideline fracas about 5½ minutes into the third quarter, the San Francisco 49ers lost linebacker Dre Greenlaw to an ejection. Dom DiSandro, the Philadelphia Eagles' head of security, was also tossed.

It was the type of trade-off the Eagles clearly got the better of -- but also left the 49ers and coach Kyle Shanahan seething on the sideline.

"That's why I tried my hardest not to lose my mind and not embarrass myself too bad," Shanahan said after his team's 42-19 victory.

With 9:27 left in the third quarter, Greenlaw tackled Eagles receiver DeVonta Smith near the Philadelphia sideline after a 13-yard completion. Greenlaw lifted Smith off his feet and slammed him to the ground, which drew a penalty flag for unnecessary roughness.

2 Related

As Greenlaw and Smith stood up, Eagles staff and players rushed over and began yelling back and forth with Greenlaw and some of his teammates.

DiSandro stepped toward Greenlaw, who extended his arm as he yelled at DiSandro. Greenlaw's hand appeared to come into contact with DiSandro's face as he pointed at him, which drew the disqualification.

"I didn't get to see it all from where I'm at," Shanahan said. "But when I started hearing people explain it to me and stuff ... I just can't believe someone not involved in a football game can taunt our players like that and put their hands in our guy's face and from what I was told, Dre did it back to him and [I] was told that he kind of mashed him in the face a little bit so he got ejected. But it was a very frustrating play."

Before Greenlaw was sent out, the officials had a lengthy discussion with Eagles coach Nick Sirianni, who was pleading his case for an ejection, as linebacker Fred Warner walked with Greenlaw back to San Francisco's sideline. As Warner and Greenlaw walked, Warner said he saw the Eagles sideline waving goodbye to him as Greenlaw explained his side of what happened.

"It was such a big loss in that moment to lose him," Warner said. "That was another moment where we had to make an adjustment and stand up."

Once the decision was made, Shanahan was visibly angry, coming onto the field and screaming at the officials. Soon after, Greenlaw sprinted to the locker room to a chorus of boos from Eagles fans. DiSandro was also removed from the game but received a hearty ovation from Philadelphia fans on his way out.

According to a pool report with Walt Anderson, the NFL's senior vice president of officiating, there was a review from New York of what happened during what is known as "continuing action." That review showed that DiSandro was "contributing to the escalation" of the argument. While the rules do not allow for a retroactive flag to be thrown on DiSandro for his participation, they do allow for an ejection for it. Greenlaw's ejection was for contacting a nonplayer.

"That should never be in question, one of their guys interacting with the player on the sideline," Warner said. "So, it is what it is."

49ers linebacker Dre Greenlaw and Eagles head of security Dom DiSandro were both removed from Sunday's game in Philadelphia following their encounter on the sidelines. Bill Streicher/USA TODAY Sports

DiSandro has been with the Eagles since 1999 and also works as a senior adviser to general manager Howie Roseman. After the game, he was in the tunnel greeting Eagles players as they walked to the locker room following the loss.

"I saw Dom get booted -- that kind of pissed me off to be honest," Eagles tackle Jordan Mailata said. "I was just like, 'Why is he getting kicked off?' There was so much commotion going on. ... We were trying to ask the refs and the refs weren't telling us anything. And then I just heard the side judge, 'Why isn't he going off?' I saw him pointing at Dom and I just saw Dom walk off."

Greenlaw was leading San Francisco in tackles with seven at the time of his ejection. The Eagles scored on a 1-yard touchdown run from quarterback Jalen Hurts five plays later to trim the Niners' lead to 21-13.

Veteran Oren Burks stepped in for Greenlaw and finished with four tackles. After Hurts' touchdown, the Niners outscored Philadelphia 21-6 to close the game.

"I loved how we rallied after it," Shanahan said.

Sirianni told Shanahan at midfield after the game that he, too, didn't like the way the play went down. Shanahan said Sirianni handled it "with total class."

Greenlaw has a history of drawing unnecessary roughness penalties, as he has had two others this season and has five in his regular-season career.

In January's NFC Championship Game against the Eagles, Greenlaw drew an unnecessary roughness penalty for a hit on running back Kenneth Gainwell and an infraction for grabbing running back Boston Scott's face mask.

Still, the Niners view Greenlaw as a tone-setter for the defense and don't want him to change his aggressive approach, only temper it.

"Dre has been really the enforcer for this defense since we got here in '19," end Nick Bosa said. "And that's what makes him who he is so we're not going to knock him for being that. But in that situation, he knows he can't do that. And it was a perfect learning lesson at this moment [for] down the road. I don't think he'll make that mistake again."