Two ardent rivals faced off on Saturday. Thousands of fans cheered and jeered from the sidelines. Tension and hope, celebration and outrage all around.

There was also a college-football game.

The event itself was highly anticipated, as is normal for the Iowa-Iowa State game. But this year’s matchup also featured a bitter head-to-head clash of a political kind that started even before kickoff occurred.

Former President Donald J. Trump and Gov. Ron DeSantis of Florida, the front-runners in the Republican primary, both appeared at the game: Mr. Trump, in a private suite, and Mr. DeSantis, in the stands alongside the state’s popular governor, Kim Reynolds.

It was the first time the two were at the same event since the Iowa State Fair, at which Mr. Trump and his supporters taunted Mr. DeSantis, who was heckled and cursed at as he strolled the fairgrounds with his family.

A month later, at Jack Trice Stadium, the roles appeared to be reversed, with Mr. Trump on the receiving end.

The former president entered the game to a mix of applause and audible boos, as a plane with a banner reading “Where’s Melania?” flew overhead — a nod to the absence of his wife from the campaign trail. Some attendees gave him the middle finger from the stands while he looked on from the glass-paneled box from which he watched the game.

Two people wearing inflatable costumes resembling Mr. Trump and Anthony Fauci, who managed the Covid response during the Trump administration and has been a target of Mr. DeSantis’s — took photos with game attendees.

Still, Mr. Trump is dominating Iowa in the polls, despite eschewing the town-to-town retail politicking that is tradition in the state.

Before kickoff, a crowd of several hundred gathered near the loading dock where Mr. Trump was expected to enter the stadium. Another large group crowded around the suite from which he watched the game during halftime, simply hoping for a glimpse of the former president.

While Iowa voted for Mr. Trump in 2020 with an eight-percentage-point margin, the state’s two major college towns — Ames, where the game took place, and Iowa City, home of the rival Iowa Hawkeyes — are quite blue.

The attacks came out early, before either candidate arrived at the game. Mr. DeSantis’s super PAC, Never Back Down, released a new online ad ahead of the game — which was devised to reach digital devices in the area around the stadium — criticizing the former president’s previous support for transgender women competing in the Miss America pageant as “insanity.” Ripped-up DeSantis posters were strewn across the grounds outside the stadium.

Ahead of the game, Mr. DeSantis appeared for roughly 15 minutes at a tailgate for the Iowa State wrestling team, where Cyclones fans played cornhole and sipped beer from red and gold koozies.

Asked by a reporter about Mr. Trump, who is leading him by double digits in the state, Mr. DeSantis made a glancing reference to the former president’s four criminal indictments, saying that “Iowans don’t want the campaign to be about the past or to be about the candidates’ issues.” Instead, he continued, “They want it to be about their future and the future of this country. And that’s what I represent.”

But even voters who are strongly considering supporting Mr. DeSantis questioned whether he could beat Mr. Trump.

“How do you overcome this deficit?” said Richard Abrams, 38, a middle school teacher from Iowa City. “How do you persuade these Trump voters to come to your side? You’ve got to win some of those people over.”

Mr. Trump and Mr. DeSantis weren’t the only candidates who vied for attention at the game. Vivek Ramaswamy, the political newcomer who has surged in the polls in recent weeks, strolled through the tailgate after several earlier appearances in the state. He garnered some attention, taking a quick shot of water from a “shot ski,” a ski to which shot glasses were attached, and shaking hands as he went. But he didn’t stay for the game, instead trying to jet off to a town hall in New Hampshire that was canceled after his plane grounded “due to inclement weather.”

Asa Hutchinson, the former Arkansas governor running on a stridently anti-Trump platform, also appeared briefly at the tailgate. In remarks to reporters, he attacked Mr. Trump’s character and took a swipe at Mr. DeSantis, who allied himself closely with the former president while running for governor in 2018.

“Donald Trump’s not going to speak the truth in this election,” said Mr. Hutchinson, who is barely making an impression in the polls. “But America needs to move in a different direction, and we don’t need a ‘Trump-lite,’ either.”

Few tailgaters seemed to notice his presence.

The day was almost a game within a game. The heckling, the fly-over and the anti-Trump ads were reminiscent of the Iowa State Fair in August, when Mr. DeSantis faced taunting from the Trump campaign and its supporters, including with a plane flying a banner that read: “Be likable, Ron!” At a sprint car race later that day, a crowd of 25,000 greeted Mr. DeSantis’s appearance with a chorus of boos.

But many in attendance at the Iowa standoff — despite the candidates’ crowds and the hubbub around their arrivals — were far more interested in the rivalry on the field than the one off it.

“I just don’t think that the focus should be on them because it’s a rivalry between colleges,” said Melanie Frueh, from St. Charles. “Granted, there’s a lot of people out there, but I just don’t see that there’s that much importance to come here and try to make a name for themselves when people are having fun in this in this context.”

Still, the game itself may not have maintained its level of appeal. The score sat at 14-3 at halftime, in favor of the Hawkeyes, and scores of crowd members left with half the game still to go.