Major League Baseball will require Milwaukee Brewers reliever Josh Hader to complete sensitivity training and participate in the league’s diversity and inclusion initiatives after offensive tweets he sent in 2011 and 2012 surfaced Tuesday night as he pitched in the All-Star Game at Nationals Park.

In a press release, MLB called Hader’s past tweets “unacceptable” and said it had contacted the Brewers to express its concerns. Brewers General Manager David Stearns called Hader’s tweets “inexcusable” in a statement and said the Brewers “do not believe that these posts are representative of his beliefs.” Neither the league nor the Brewers indicated Hader would face punishment.

In the messages, which Hader posted when he was 17 years old and a student at Old Mill High in Anne Arundel County, Hader used the n-word numerous times, referenced white power in approving tones, made derogatory statements regarding women and expressed hatred toward gay people. Twitter users found and widely shared the tweets after Hader surrendered a three-run homer in the eighth inning of the All-Star Game.

Hader, a former All-Met originally drafted by the Baltimore Orioles, faced a scrum of reporters late Tuesday night. He apologized for the tweets, said they did not reflect his beliefs and repeatedly stated they had been sent when he was 17 years old, even calling himself “a child” at one point.

“After the game, Mr. Hader took the necessary step of expressing remorse for his highly offensive and hurtful language, which fails to represent the values of our game and our expectations for all those who are a part of it,” the league’s statement read.

In his statement, Stearns said Hader “is taking full responsibility for the consequences of his actions” and the sentiments did not reflects the views of the Brewers organization.

“Those of us that have come to know Josh do not believe that these posts are representative of his beliefs,” Stearns said. “He has been a good teammate and contributor to the team in every way.”

“It’s just something that happened,” Hader, 24, said late Tuesday night. “I was 17 years old. As a child, I was immature. I obviously said some things that were inexcusable. That doesn’t reflect on who I am as a person today. That’s just what it is.”

Milwaukee teammates Lorenzo Cain and Christian Yelich, who were in Washington for the All-Star Game, initially gave Hader support, having had little time to review or contemplate Hader’s tweets. Brewers first baseman Jesus Aguilar defended Hader on Twitter a day later, after he had the chance to digest the tweets.

“He made a mistake 7 years ago,” Aguilar wrote. “He admitted, he apologized and most important: He learned from it. … Regarding accusations of racism: I’m Venezuelan and with the skin color that I have, can tell you that it is a lie. Obviously he’s not racist. He’s a great player and a better person. Great teammate. And you know it.”

Hader became the latest professional athlete stained by offensive social media posts from his youth. Shortly before the NFL draft, racist tweets quarterback Josh Allen sent in high school came to light. Allen apologized, called himself “young and dumb” and eventually was picked in the first round by the Buffalo Bills. Villanova basketball player Donte DiVincenzo experience similar scrutiny the night of the NCAA championship game.

While social media and Twitter have grown embedded in sports and society, athletes in their early 20s are among the first generation who have built an archive of their personal thoughts online, and therefore among the first generation exposed to having their past surface in damaging fashion.

Leagues and teams, then, are also navigating new territory, forced to determine the proper response to actions made by players before they were their employees, often before legal adulthood. Should players be punished for actions taken years ago — and would it even be legal under a collective bargaining agreement? Is public shame and counseling enough?

Doug Hartmann, a sociology professor at the University of Minnesota who has written extensively on race and sports, said he believed MLB erred in deciding so quickly to only condemn Hader without punishing him, rather than looking further into his tweets and beliefs.

“They’re trying to already forgive him and make space for him to move on,” Hartmann said. “We’ve tried to protect the heroic image, the role model image of athletes, especially superstars. I don’t know that we give the same benefit of the doubt to everyone on all the different issues that are going on in society right now.”