“Secretary Clinton prevailed upon the governor of New York, Eliot Spitzer, who wanted to do the right thing and provide driver’s licenses to those who were undocumented,” Mr. Sanders said. “She said, ‘Don’t do it,’ and New York State still does not do it.” He also noted that he had supported allowing children from war-torn Central American countries to enter the United States and asserted that Mrs. Clinton’s view was “send them back.”

“That is something that is not fair about what I said,” Mrs. Clinton said. “I did say we needed to be very concerned about little children coming to this country on their own, very often, many of them not making it, and when they got here, they needed, as I have argued for, legal counsel, due process, to make a decision.”

Both candidates, who consistently praise President Obama on most issues, vowed to end the mass deportations of his administration. They both flatly promised not to deport children.

Mrs. Clinton projected steeliness throughout the debate and did not seem fazed by her loss in Michigan, taking comfort in her accumulation of more of the delegates needed to win the Democratic nomination. She has a steadily growing delegate lead over Mr. Sanders in spite of his successes, because her margins of victory have been greater.

Yet she was careful to show that she was not taking the nomination for granted, even pushing back against a question about whether she had gotten ahead of herself in assuming she had all but beaten Mr. Sanders.

“I’m continuing to work hard for every single vote across our country,” Mrs. Clinton said. “I was pleased that I got 100,000 more votes last night than my opponent, and more delegates.”