WASHINGTON —  Milwaukee Brewers reliever Josh Hader took responsibility for racist and homophobic tweets that resurfaced while he was pitching in the All-Star Game on Tuesday night.

Hader was alerted to an online firestorm regarding the tweets when he came out of the game. He locked his account and after the game he said the posts were from seven years ago and stemmed from immaturity when he was 17.

“There’s no excuse for what was said,” Hader said. “I’m deeply sorry for what I’ve said and what’s been going on. It doesn’t reflect any of my beliefs going on now.”

Asked if he was worried about facing discipline, the 24-year-old said he would live with it. “I’m ready for any consequences that happen for what happened seven years ago,” Hader said.

Deputy Commissioner Dan Halem, speaking outside the NL clubhouse, said he had spoken to Hader. He said Major League Baseball would not have any comment before Wednesday.

Hader, who is averaging almost 17 strikeouts per nine innings this season, could face some kind of discipline from Major League Baseball. The league suspended the former Toronto infielder Yunel Escobar for three games in 2012 for wearing eye black with a homophobic slur written on it, and suspended the Toronto outfielder Kevin Pillar two games last season for directing a homophobic slur at a pitcher.

MLB employs Billy Bean, a former outfielder who is gay, as an ambassador for inclusion, and about 200 of its officials took part in the Pride March in New York last month.

Some of the tweets that surfaced were from 2011 and 2012. Hader said he did not “vividly” remember the tweets.

“I’m sure there’s some lyrics, some rap lyrics being tweeted,” Hader said. “I really don’t know exactly what’s all out there.”

As Hader’s tweets were going viral, some of Hader’s friends and family in attendance were given blank gear in the stands. They were wearing blank National League gear outside the clubhouse toward the end of the game.

Hader said he had not spoken to family members and when asked if that would be a difficult conversation responded: “I was young, immature and stupid. There’s no excuses for what was said or what happened.”

Hader, who allowed four hits including a home run to Seattle’s Jean Segura, talked to Brewers teammate Lorenzo Cain in the clubhouse after the NL’s 8-6 loss. Cain said he did not ask for an apology and simply wanted to understand the situation before speaking with reporters.

“We’ve all said crazy stuff growing up, even when we’re 17, 18 years old,” Cain said. “If we could follow each other around with a recorder every day, I’m sure we all said some dumb stuff. Basically, we’re going to move on from this. He said it. It’s over with. It’s done with.”

Brewers outfielder Christian Yelich said: “I don’t know what he did or what happened. The guy I know, he’s a great guy. Really kind heart.”

Hader, a native of Millersville, Maryland, cited his youth for sentiments shared in the tweets. “Being 17 years old, you make stupid decisions and mistakes,” Hader said. “I was in high school. We’re still learning who we are in high school. You live and you learn. This mistake won’t happen again.”

The New York Times contributed to this report