Democratic frontrunner Hillary Clinton dodged a question at a presidential debate about why she suffered a surprise loss to rival Bernie Sanders in Michigan and stepped up her attacks on the Vermont senator.

Fresh from the upset in the northern industrial state, Mrs Clinton twice declined to say why she failed to win a state in Tuesday’s ballots that polls had her leading by more than 20 points in the run-up to voting. She instead focused on next week’s big contests in Ohio and Florida.

“It was a very close race,” Mrs Clinton said, at the eighth Democratic presidential debate hosted by Latin TV network Univision in Miami.

“We’ve had some of those. I’ve won some. I’ve lost some. But, you know, I was very pleased by the overall outcome last night.”

Mr Sanders won Michigan’s Democratic primary by 50 per cent to 48 per cent, but Mrs Clinton won Mississippi by a landslide, winning her on the night the most total delegates who will formally pick the candidate to stand as the Democratic nominee in November’s presidential election.

His victory in Michigan, which has a larger black population than some of the mostly white states Mr Sanders has won, showed he could perform better-than-expected in looming contests in big-delegate states of Ohio and Illinois, and slow Mrs Clinton’s march to the nomination.

Appearing before a Hispanic audience, each candidate highlighted weaknesses in the other’s voting records on immigration, a lightning-rod issue for a party that relies heavily on the support of minorities.

Mrs Clinton noted Mr Sanders’s vote against a 2007 comprehensive immigration bill, while he referred to her opposition to driver’s licences being issued to undocumented immigrants in New York.

Both candidates pledged not to deport illegal immigrants who had no criminal records. This is in contrast to leading Republican candidates, businessman Donald Trump and Texas senator Ted Cruz, who have promised to deport the country’s 11 million undocumented immigrants.

In one of her testier responses, Mrs Clinton dismissed a question about whether she would drop out of the presidential race if she was indicted on the back of an FBI investigation into whether classified security information ended up in the private email she used as secretary of state.

“Oh, for goodness - that’s not going to happen. I’m not even answering that question,” Mrs Clinton said, cutting off moderator Jorge Ramos.

Mrs Clinton repeated her misleading claim that Mr Sanders rejected the 2009 bailout of the motor industry, a charge that some suggested may have hurt her in Michigan after she raised it there in last Sunday’s debate.

“What the secretary is doing tonight and has done very often is take large pieces of legislation and take pieces out of it,” said Mr Sanders.

The former first lady kept up her attacks on Mr Trump, dismissing his plan to build a wall along the border with Mexico.

“He’s talking about a very tall wall, right? A beautiful tall wall, the most beautiful tall wall, better than the Great Wall of China, ” she said, mimicking the billionaire’s repetitive tick.

“That he would somehow magically get the Mexican government to pay for. And, you know, it’s just fantasy.”

Elsewhere in Miami, Florida senator Marco Rubio, who must win his home state next week to keep his presidential hopes alive, ruled out a proposal that he drop out and become Mr Cruz’s running mate, creating a strong anti-Trump force to stop the billionaire winning the nomination.

At a televised townhall meeting hosted by news channel MSNBC, Mr Rubio dismissed the idea as “House of Cards stuff” - a reference to the popular Machiavellian political drama about Washington power struggles.

“It looks good on TV. It doesn’t ever work that way,” Mr Rubio said. “The bottom line is this process is going to play itself out.”