The Texas Rangers are investigating claims that a white fan harassed a Hispanic family during Saturday’s game in Arlington, just hours after a gunman purportedly posted an anti-immigrant screed and slaughtered 22 people at an El Paso Walmart.

Jessica Romero, of Fort Worth, detailed the unprovoked hatred she says she received from a man who complained about Hispanic fans sitting in front and behind his family during the game, saying he made his disdain for them “perfectly clear” shortly after the game got started.

“And he just so happened to have a Hispanic family (us) sitting in front of him and another one sitting directly behind him,” Romero wrote in a Facebook post that shows a white fan holding up his middle finger as the woman’s family took a selfie.

Later in the second inning, Romero said, the man got irritated when a little boy behind him kicked his seat, setting off a nasty, hate-filled racist tirade.

“And for the next 3 innings I had to hear him complain about all the illegal immigrants that were surrounding him at the game,” Romero’s post continued. “That he should kick little Speedy Gonzalez all the way back to Mexico for kicking his seat.”

The harassment led Romero’s family to leave the game during the fifth inning, they said. The Rangers went on to beat the Detroit Tigers 5-4 in extra innings.

“Sadly this is not the first or the last time we will ever experience this kind of racism,” Romero wrote in the post, which had been shared more than 58,000 times as of Tuesday.

The team is looking into the incident and has reached out to the family, the Dallas Morning News reports.

Romero’s husband, Ramon, told the newspaper that the majority of the verbal harassment occurred as he went to get his son a hot dog. His wife later told him what the fan behind them said as they left the stadium.

Team officials, meanwhile, said the incident violated their fan code of conduct, and apologized for the “offensive behavior” that the couple and their 6-year-old son, Nomar, endured at the game.

“After learning of this incident on Sunday, we reached out to the Romero family and pledge to make their next trip to Globe Life Park a memorable and enjoyable experience,” the team said in a statement to the Dallas Morning News.

A team spokesman confirmed to The Post on Tuesday that the Rangers are “certainly investigating” the incident, but declined further comment.