MIAMI — Moderator Savannah Guthrie tried to move to a commercial, but a male voice interrupted. It was New York Mayor Bill de Blasio, trying to get in a word on about Iran. Guthrie smiled, pledging to return soon to the “very anxious candidates.”

It was one of several awkward moments as more than a half-dozen Democratic hopefuls polling among the bottom of the pack tried to engineer a breakout moment during the first debate of the Democratic presidential primary.

De Blasio and former Maryland congressman John Delaney often interrupted their opponents while former secretary of housing and urban development Julián Castro tried to display his expertise on immigration. Washington Gov. Jay Inslee touted his gubernatorial record.

Rep. Tulsi Gabbard (Hawaii) leaned on her military service and lashed out at Rep. Tim Ryan (Ohio) over his support for further engagement in Afghanistan, initiating one of the evening’s most heated exchanges.

When the Democratic National Committee randomized debate stage lineups, they did so hoping to avoid one night featuring high-profile candidates and another of those looking to join the top tier. As it happened, Wednesday night’s field included only three candidates averaging more than 1 percent in national polls: Massachusetts Sen. Elizabeth Warren, New Jersey Sen. Cory Booker and former Texas congressman Beto O’Rourke.

With so many candidates getting their first chance at the spotlight, airtime became precious currency. Those who felt moderators didn’t give them enough of it decided to take it.

For example, after a somewhat slow beginning to the debate, de Blasio became the first candidate to interrupt when he challenged O’Rourke, who was explaining why his health- care plan would preserve private insurance.

“Why are you defending private insurance to begin with?” de Blasio asked.

Delaney, not O’Rourke, answered.

“One hundred million Americans say they like their private health insurance, by the way,” Delaney said. “I think we should be the party that keeps what’s working and fixes what’s broken.”

Delaney tried to elbow his way into discussions over and over, including at the end of a long back-and-forth on immigration, of which he had not been a part.

“Can we talk about the conditions about why people are coming here?” Delaney asked. The moderators moved on to other candidates.

“My grandfather was actually separated from his family when he came to this country,” Delaney called over the noise.

“We’re going to talk about Iran now,” Lester Holt said, and Delaney had to wait. Delaney’s press secretary, Michael Hopkins, later said Delaney was not given as much time as the other candidates. De Blasio’s senior adviser Steve Jarding said the same.

Delaney was shut out of that immigration conversation in part because Castro had taken control of it. The San Antonio native and the only Latino candidate in the field explained that he had been the first candidate to outline a policy for immigration reform. He challenged other candidates onstage to support repeal of the section of the law that criminalizes immigration. When O’Rourke could not say that he would, his fellow Texan did not hesitate.

“I think that you should do your homework on this issue,” Castro told O’Rourke. “If you did your homework on this issue, you would know that we should repeal this section.”

Faced with a question about climate change, Castro found a way to underscore his experience as HUD secretary and mayor of San Antonio. “I’m one of the few candidates in this race with executive experience,” he said.

He also highlighted his trip to Puerto Rico, which was hard-hit by Hurricane Maria in 2017, and stressed that his first campaign visit was “not to Iowa or New Hampshire.”

As Castro tried to claim immigration as his issue, Gabbard, a veteran of the war in Iraq, tried to establish herself as the most credible voice on foreign policy issues. When Ryan suggested the United States should maintain a presence in Afghanistan, Gabbard dug in.

“As a soldier I will tell you that answer is unacceptable,” Gabbard said. “We have to bring our troops home.”

Ryan argued that a U.S. presence in Afghanistan was necessary to prevent the ruling Taliban from growing as a terrorist threat, and suggested that it flew planes “into our buildings.”

“The Taliban didn’t attack on 9/11,” Gabbard corrected him. “Al-Qaeda did.” Ryan clarified later that he meant the Taliban was complicit in the attacks.

De Blasio explained that he is the only candidate onstage “raising a black son” in America. Booker, who lives in Newark, said he hoped he was the only candidate onstage “who had seven people shot in their neighborhood last week.”

At times, the candidates’ attention-grabbing tactics obscured their messages. At other times, they highlighted them. De Blasio used every opportunity to argue that the Democratic Party should become “the party of working people again.” Delaney cast himself in contrast to de Blasio, Warren, and other high-reaching candidates, arguing for “real solutions instead of impossible promises.”

Midway through the debate, even as Delaney was visibly frustrated with his airtime, a member of Delaney’s campaign staff emailed a tweet, proudly showing evidence that Delaney was trending on Twitter. Attention, however much he had to fight for it, was welcome.