Asked by moderators from Univision and The Washington Post how their immigration policies would differ from those of President Barack Obama, who's overseen millions of deportations during his presidency, both candidates pledged to end the practice of deporting children and illegal immigrants who are caught here but do not have a criminal record.
During that debate, Clinton hit Sanders repeatedly for his vote against a comprehensive immigration bill drafted by the late Sen. Ted Kennedy in 2007.
Sanders responded, saying he opposed the bill because of a migrant worker provision he said would have put many such individuals into a system of virtual "slavery."
"If you're asking about the 11, 12 million who are living here, my priorities are to deport criminals, terrorists, anyone who threatens our safety," Clinton said. "I do not have the same policy as our current administration does."
Sanders shot back at Clinton during the exchange: "I will stand in terms of my political career, fighting for workers, fighting for the poorest people in our country. Madam Secretary, I will match my record against yours any day of the week."
The boisterous audience burst into sustained applause at the zinger.
The Democratic candidates were also asked about the Republican front-runner, Donald Trump, and whether they believe he is a racist. Both candidates stopped short of saying yes, but delivered stinging criticism of Trump's comments.
Trump has labeled some Mexican immigrants "rapists" and called for a ban on all Muslims entering the country. Clinton responded first, instead calling Trump's views "un-American."
"There will be a lot of time to talk about him. I'm the first one to call him out. I called him out when he called Mexicans rapists," Clinton said. "People can draw their own conclusions about him. You don't make America great by getting rid of everything that made America great."
"I think that the American people are not going to elect a president who insults Mexicans, who insults Muslims, who insults women, who insults African Americans," he said.
He went on to criticize Trump's participation in the so-called birther movement, which questioned Obama's birth certificate.
"I find it very interesting, my dad was born in Poland. Nobody has ever asked me for my birth certificate. Maybe that has something to do with the color of my skin."
Wednesday is the second time in a week the Democratic candidates for president have met on the debate stage.
But after scoring a major upset win in Michigan, the campaign looks a lot different for Sanders, the Vermont senator whose liberal challenge to the former first lady and secretary of state is proving more durable and substantive than many assumed.
When Clinton and Sanders met in Flint, Mich., on Sunday ahead of that state's primary, polls showed Clinton poised to score a big victory -- big enough it could have put the race all but out of reach for Sanders.
The polls were wrong. Instead of a Clinton landslide, Sanders squeaked out a victory in Michigan and entered this debate with some real wind at his back for the first time since claiming a resounding victory in the first primary of the campaign, New Hampshire, a month ago.
Both candidates were asked about the Michigan results on Wednesday. Clinton pointed to her net win in delegates Tuesday night, which included her landslide victory over Sanders in Mississippi.
"I'm continuing to work hard for every single vote across our country," Clinton said. "I was pleased I got 100,000 more votes and more delegates than my opponent. This is a marathon."
Sanders crowed about the victory, calling Michigan "one of the major upsets in modern political history."
Wednesday's debate happened in Miami and Florida is one of four states voting on Tuesday. It is a true battleground both in the primary, and in the general election. Both candidates have pledged to devote resources to campaigning there, but the other prizes on Tuesday are just as much at the forefront.
Another general election battleground, Ohio, also votes Tuesday. And the other two states, Illinois and Missouri, are also in the Midwest. The trio of large Midwestern states offers Sanders the opportunity to prove his victory in Michigan was no fluke -- and it offers Clinton the ability to deal the knockout blow she could not on Tuesday.
The debate, the eighth of the campaign, was broadcast on Univision and CNN.