When Red Sox fans hurled peanuts and the N-word toward Orioles outfielder Adam Jones in Fenway Park, it was a reminder of the Boston’s racial legacy – particularly around its sports teams.

Boston’s reputation as a racist sports town developed through decades of barriers broken and maintained, intertwined with broader struggles for progress along with today’s climate of racial tension that sports can’t avoid.

Despite its teams and the city making strides on race, Boston still has perceptions of racism to overcome.

”Boston has a reputation, partially left over from a long time ago, that there is more racism within Boston sports,” said Richard Lapchick, director of the Institute for Diversity and Ethics in Sport at the University of Central Florida. ”The type of incident that happened … is something I would’ve expected to read about in Boston 25 years ago.”

Jones was given an extended ovation on Tuesday night as he stepped to the plate for his first at-bat, a moment sharply different from what he described Monday night, saying he heard fans call him the N-word and had peanuts thrown in his direction in the dugout, hitting a nearby police officer.

The All-Star said he felt ”it was just the right time” to speak out after experiencing previous racial heckling at Fenway over 12 seasons, though he said it was more a sign of larger racial issues than an indictment of Boston or its fans. Several black ballplayers Tuesday said Jones was just describing what they regularly experience.

The Celtics and the Bruins were pioneers in professional basketball and hockey during the 1950s. But the Red Sox were the last Major League Baseball team to field a black player. Pumpsie Green debuted at Fenway in 1959 – more than a decade after Jackie Robinson played for the Dodgers, and even after Willie O’Ree took the ice for Boston in the all-white National Hockey League.

The Red Sox ballpark and offices are located on Yawkey Way, named for franchise owner Tom Yawkey who presided over the team at the time. The Red Sox passed on Robinson in 1945 and also passed on a chance to sign future Hall of Famer Willie Mays.

The Celtics were the first team to draft a black player, the first to field an all-black starting five and the first to hire a black head coach. Bill Russell was among the league’s first black players and champions, but wasn’t embraced by fans during his career and was embittered by his experience in Boston for years, though he is now a beloved figure in the city. In the 1980s, the rivalry between the white Celtics Larry Bird and the African-American Lakers star Magic Johnson epitomized the NBA’s racial divide. Earlier this season, Celtics forward Jae Crowder, who is black, said he felt ”disrespected” by fans openly coveting white potential free agent Gordon Hawyard, who is white, rekindling the debate.

In 2012, some fans upset with the Washington Capitals bouncing the Boston Bruins from the NHL playoffs lobbed racial insults on Twitter toward Joel Ward, a Canadian who is black. And in an episode of Saturday Night Live before the New England Patriots played in the Super Bowl this year, comedian Michael Che called Boston ”the most racist city I’ve ever been to.”

Boston fans pride themselves on rabidly supporting one of America’s greatest sports cities. While the Sox-Orioles rivalry shouldn’t automatically result in racism, ”for some white Americans, that’s often where they go if they’re angry,” said University of Hartford sociologist Woody Doane.

”Pulling a racial epithet out of our back pocket is something a lot of us still do,” said Doane, who studies sports, society and whiteness.

Boston’s racial history – including fights over segregated housing, schools and politics – has spilled into sports as some working class residents experience a ”white crisis,” said University of Connecticut sociologist Matthew Hughey.

”They can’t live up to the levels of superiority they’re told they’re supposed to naturally have, so they turn to symbolic things or people to build a sense of identity and to take out a sense of frustration,” Hughey said. ”Sports can be that sense of identity.”

Ballparks can also be an environment where some people feel more comfortable expressing offensive views while others feel uncomfortable or unwelcome.

More black and Latino fans have begun attending games at Fenway, but they remain largely in the minority, said Doane, who has regularly attended Red Sox games since 1963.

”It’s a white space,” Doane said. ”If you are a person of color there, you would definitely feel in the minority.”

The situation is not much different for players on the field. Lapchick’s 2017 report card on Major League Baseball showed only 7.7 percent of players are African-Americans – the lowest figure in the years since the institute has tracked the data. Black players have long commented on the atmosphere at Fenway, saying they expect racial taunts.

On Tuesday, Yankees pitcher CC Sabathia said: ”You get called names, N-word, all kinds of stuff when you go to Boston.

”We know,” he said. ”There’s 62 of us and we all know: When you go to Boston, expect it.”

Both the city and its sports franchises have changed in recent years. Last season, the Patriots started a black quarterback for the first time. The Red Sox have several African-American players in their starting lineup. And Celtics guard Isaiah Thomas is currently leading his team in the NBA playoffs.

Red Sox President Sam Kennedy said his ownership group made it a mission in 2002 to ”acknowledge the shameful past of the Boston Red Sox” and its reputation as an unfriendly environment.

”We’ve worked really hard to change that. We want to open up Fenway Park to everyone,” Kennedy said. ”Everyone should feel comfortable at Fenway Park. No matter your race, religion, political beliefs, your sexuality – you are welcomed at Fenway.”

Boston’s neighborhoods have diversified and its racial boundaries have become less rigid. The city’s population is now a quarter black, up from roughly 16 percent in 1970 and 3 percent in 1940. Since 2000, at least half of Boston’s population has been made up of minorities.

Kennedy, Mayor Marty Walsh and Gov. Charlie Baker were all swift Tuesday to condemn the fan behavior. While Kennedy called the conduct the acts of ”an ignorant few,” city councilor Ayanna Pressley said in a statement that the incident ”lays bare the racism that many residents of our city grapple with on a regular basis.”

It may also be a sign of the times, said Lapchick.

”This is one more alarm bell that racism is alive and well in the United States,” he said. ”To think it doesn’t take place in sports, or in any other aspect of our society would be naive on the part of the public. But it puts it in our face more when something like that happens in a ballpark.”

—

AP sports writers Kyle Hightower and Jimmy Golen in Boston and Mike Fitzpatrick in New York contributed to this report.

—

Errin Haines Whack covers urban affairs for The Associated Press. Follow her work on Twitter at http://www.twitter.com/emarvelous .