A fan was arrested for throwing a beer on the court during an NBA game between the Celtics and San Antonio Spurs on Wednesday night -- after Boston's Kemba Walker was controversially ejected for using back-to-back profanities.

Midway through the third quarter at TD Garden in Boston, Walker collided hard with 260-pound LaMarcus Aldridge during a screen that wasn't called a foul by the referees. Crew chief Rodney Mott later told a reporter that Aldridge was set, so a foul wasn't called.

Angry about what many saw as a missed call, Walker reportedly gave some harsh words to referee Evan Scott, who charged him with two technical fouls and ejected the player.

HEAT'S JIMMY BUTLER, PACERS' TJ WARREN GET INTO VERBAL ALTERCATION ON THE COURT

“I thought I was being nice,” said Walker. “I thought the ref missed the call. ... The rest is history.”

Boos rained down from the home crowd in the stands and a fan launched a beer that landed in front of the Spurs bench and rolled onto the court, requiring a short delay in the game so crews could clean up the mess.

Celtics spokesman Christian Megliola said the suspect was promptly located and arrested. The fan's identity wasn't immediately made available.

WARRIORS' KERR FINED FOR BEHAVIOR AFTER SACRAMENTO EJECTION

Celtics coach Brad Stevens apologized to San Antonio head coach Gregg Popovich after the incident.

CLICK HERE TO GET THE FOX NEWS APP

“I told Pop after the game I'm really sorry that they had to experience that," Stevens said. “I hope that person's not allowed in an NBA arena again.”

The Associated Press contributed to the report.