President Donald J. Trump was nowhere near Tallahassee this week. But you could feel his presence on the issue that defines his deeply troubled presidency more than any other.

Immigration.

Emotions are running high in the state Capitol over the Legislature’s plan to enact a ban on so-called sanctuary cities, which opponents say don’t even exist in the first place and would only terrify law-abiding immigrants. This drama is playing out in one of the most diverse states in the country, a place where undocumented immigrants are critical to a thriving economy where two pillars are agriculture and tourism.

But a presidential election is coming, and the Florida Legislature is the test-track circuit for the next cycle’s political messaging.

Despite the rhetoric from Republicans about the need to enforce federal immigration laws, this is not about public safety. It’s about politics, and helping Trump carry an anti-immigrant message to victory in Florida for the second time as he seeks re-election next year.

The rank-and-file legislators who are voting for a sanctuary city ban are like the people you see on TV in the background at a Trump rally. They’re extras who are just along for the ride.

The first tipoff is that the sponsor of the sanctuary city ban in the Senate is a fairly obscure first-term senator, Republican Joe Gruters of Sarasota.

Joe who? Who is this guy? And why is he carrying such a high-profile issue?

What matters for Gruters is his dual status as chairman of the Republican Party of Florida and the fact that he was an early Trumper at a time when most Republicans were rallying around Marco Rubio or Jeb Bush.

Gruters, a hard-liner on illegal immigration, welcomes visitors to his Senate office in Tallahassee with a large poster of mean-looking mug shots and the headline: “Faces of criminal illegals deported from Sarasota County.”

It’s Gruters’ job to win elections for Republicans in Florida in 2020, and if Trump carries Florida again, he’ll be on top of the political world.

“This bill only deals with people who have been arrested for breaking the law or been convicted,” Gruters said as he introduced his bill, SB 168, before a standing-room-only crowd Wednesday at the Senate Rules Committee. He talked a lot about applying the rule of law to immigration enforcement.

Democrats disagree and say the bill could entrap immigrants charged with minor crimes, such as traffic violations.

“This bill is divisive, unnecessary and makes us less safe,” said Sen. Jose Javier Rodriguez, D-Miami. He proposed one amendment after another to limit the bill’s impact, all to no avail.

For example, the bill requires state and local governments to cooperate with federal immigration authorities by honoring detainers, or cases in which the feds claim to have probable cause that an immigrant should be deported. Courts have questioned the legality of federal detainers.

Gruters says it’s all about public safety. Rodriguez said local libraries and mosquito control districts could be forced to act as immigration police. The Democrats tried without success to exempt the Florida Department of Children and Families from the bill, arguing that DCF’s job is to keep families together, not tear them apart.

The two-hour hearing in the Senate Rules Committee Wednesday became tense and obnoxious. Trump would have loved it.

Yvonne Larsen of Fort Myers said she fled a sanctuary city — Houston — and told senators: “I’m really glad I didn’t choose to live in Miami.”

The panel’s chairman, Sen. Lizbeth Benacquisto, R-Fort Myers, interrupted Larsen and said: “That is absolutely not appropriate.”

Then, Sen. Gary Farmer, D-Lighthouse Point, lashed out at Larsen, telling her: “Ma’am? The woman who decided not to live in Miami? We appreciate that. I know the skin there might be a little too tan, and the language may sound funny ... ”

“Senator Farmer, that is enough,” Benacquisto chastised him.

Some wept as they testified in opposition to the bill. Margarita Romo of Dade City, a long-time advocate for farm workers and a member of the Florida Civil Rights Hall of Fame, warned that families would be broken up.

“This is an attack on immigrant communities,” Romo said as she described the emotional toll on immigrant families and their children.

Amy Morales, a Florida State University student leader, said her father was deported when she was 9 years old. Turning to Gruters, she said, “Please stop referring to my father as an illegal alien, because that’s not what he is.”

Tomas Kennedy of the Florida Immigrant Coalition said a person stopped by police three times for driving without a license can be charged with a felony, but that since Florida does not allow undocumented immigrants to hold driver licenses, “(Those) people will be impacted by this bill and they will be deported.”

The bill passed on a 9 to 8 vote, as one Republican, Sen. Anitere Flores of Miami, sided with seven Democrats, five of whom are from South Florida (Sens. Oscar Braynon, Lauren Book, Perry Thurston, Farmer and Rodriguez).

If just one other Republican senator had voted no, the bill would have failed. But now it heads to the Senate floor, with two weeks left in the session.

Steve Bousquet is a columnist for the South Florida Sun Sentinel in Tallahassee. He can be reached at sbousquet@sunsentinel.com or (850) 567-2240. Follow him on Twitter @stevebousquet.