Democratic presidential candidate Bernie Sanders expressed confidence in Miami following Democratic primary elections in Mississippi and Michigan. (Reuters)

Sen. Bernie Sanders pulled off a narrow upset in the Michigan primary Tuesday, buoying his challenge to Democratic front-runner Hillary Clinton and giving him bragging rights to a big, diverse state outside his previous areas of strength.

Sanders’s come-from-behind victory was fueled by a relentless focus on his opposition to “disastrous” trade deals that have battered the manufacturing sector in Michigan. He will carry the same message to Ohio, North Carolina, Illinois and Missouri next week.

Clinton, meanwhile, cruised to an expected win in the primary in Mississippi, the latest in a series of contests in Southern states where she has bested Sanders largely on the strength of her appeal to African American voters.

Clinton had always been favored in Mississippi, and Sanders did not seriously compete there. With most precincts reporting late Tuesday, she boasted a 67-point lead. Clinton’s victory was amplified by her strength among African American voters — who made up a greater share of the electorate in Mississippi than in any other state that has voted this year, according to preliminary exit polling reported by CNN.

In Michigan, Sanders performed more strongly among black voters than he has in other states.

“What tonight means is that the Bernie Sanders campaign . . . is strong in every part of the country, and frankly, we believe that our strongest areas are yet to happen,” the senator from Vermont said during a hastily arranged address to reporters here.

“What the American people are saying is they are tired of a corrupt campaign finance system and super PACs funded by Wall Street and the billionaire class.”

Despite Tuesday’s split decision, Clinton’s overwhelming victory in Mississippi increased her large lead in the delegate count needed for the Democratic nomination. But Sanders’s triumph in Michigan — on the heels of wins in three smaller states over the weekend — signals that the nomination fight is likely to remain a slog. Sanders has vowed to stay in the race until the Democratic convention in July, and his advisers have argued that the upcoming calendar of states is more favorable to him than those that have voted thus far.

The outcome raises the stakes for a candidates’ debate Wednesday, sponsored by The Washington Post and Univision and broadcast from delegate-rich Florida, which also holds a primary next week. It will also air on CNN.

Clinton has now won 13 states in this Democratic primary contest, including eight from the old Confederacy, where black voters are a major force in any Democratic race. Sanders has won nine states, but — because many of his victories were in smaller states, and because Clinton has dominated among superdelegates, who make up their own minds — he is far behind in the race for delegates to the Democratic convention.

Michigan was the prize Tuesday, with 130 delegates at stake. With most precincts reporting, Sanders was ahead by two percentage points.

On the eve of the primary, Clinton urged her supporters to vote so that she could quickly wrap up the Democratic nomination.

Tracking the race to the Republican nomination

“The sooner I can become your nominee, the more I can begin to turn my attention to the Republicans,” she told a crowd of nearly 900 in Detroit.

She moved on to next-door Ohio — which will vote next Tuesday — where she addressed a primary night party before the results in Michigan were clear.

She pivoted past Tuesday’s contests to appeal to Ohio voters, merging her economic message with her call for a kinder, gentler politics. She noted her support for the auto bailout when the industry was “on the brink.” And she touted her proposal to force companies that move their operations overseas to pay an exit tax.

“America grows when your paycheck grows,” Clinton said. “And I know the idea of corporate patriotism might sound quaint in an era of vast multinationals, but that’s exactly what we need.”

“Because we really are all in this together,” she added.

Sanders campaigned hard in Michigan, holding large rallies across the state over the past week and hammering Clinton for what he called her record of failure on trade and job protection — an appealing message in a state that has lost manufacturing jobs.

“While others waffle, Bernie is fighting hundreds of thousands in new job losses,” said the narrator of a Sanders television ad in heavy rotation in the state.

Nearly 6 in 10 Michigan Democratic primary voters said international trade takes away U.S. jobs, and Sanders won those voters by roughly 20 percentage points, according to preliminary exit poll data reported by CNN. Only 3 in 10 said trade with other countries creates domestic jobs, and Clinton won this group narrowly, 50 to 45 percent.

Sanders was losing African American voters by 2 to 1 in the preliminary exit polling, which would mark a significant improvement for him. He has lost black voters to Clinton by an average of 84 to 16 percent across primary states with exit polls this year.

His campaign had pledged to try to improve outreach to black voters, starting in Michigan, where the auto industry and manufacturing once fueled the expansion of a black middle class that has now been hollowed out.

Clinton focused on turning out African American voters, who, while not a majority of the Democratic electorate in Michigan, are a reliable and concentrated constituency. She has championed the residents of majority-black Flint, beset by a lead-poisoning crisis. She secured the endorsement of the city’s mayor and made her response to the lead crisis a major part of her outreach to African Americans. Remarkably, Sanders was ahead in Genesee County, home of Flint, late Tuesday.

Sanders’s aides had acknowledged that he had to start winning some big states to have any chance of catching Clinton in the delegate count. Michigan was seen as a nearly ideal target, given Sanders’s core message of a “rigged economy” and his emphasis on opposition to trade deals dating back to the North American Free Trade Agreement of the early 1990s.

The candidate left Michigan early Tuesday afternoon and headed to Miami, where he held an evening rally. He plans to actively campaign in Florida, which has a key primary next week, though aides concede that it will be a tough fight, in part because of demographics. The state has a large elderly population, which has been a Clinton strength.

Sanders, by contrast, has done far better with younger voters.

Sanders aides said he is also targeting other states that will vote next Tuesday: Illinois, Missouri, North Carolina and Ohio.

Clinton’s advisers had sought to lower expectations in recent days, saying Sanders had some advantages among the working-class, whiter Democratic electorate in Michigan. Her advisers had said they were confident she would win, however.

Clinton campaign manager Robby Mook sent out a fundraising plea Tuesday that suggested she could lose one of the day’s elections. “It’s absolutely critical that we pick up the momentum we need to take the last of March’s big contests,” the pitch read.

“In just one week, Florida, Ohio, Illinois, North Carolina, and Missouri will vote, with 691 pledged delegates at stake — that’s almost as many as Super Tuesday. If we can bring home a substantial portion of those delegates, we can make a decisive statement that Hillary will be our party’s nominee,” Mook wrote.

“But if Bernie narrows our lead too much, this primary could drag on for months, siphoning time and money away from the work we need to start right now to win in November.”

Because of his online fundraising prowess, Sanders’s aides have argued that he has the luxury of more time than would otherwise be the case, given his deficit in the delegate chase.

Many candidates drop out of presidential races because they run out of money. Sanders doesn’t face that danger anytime soon.

In the closing days of the Michigan contest, Sanders found himself largely playing defense, seeking to push back against a charge Clinton made in Sunday’s CNN debate in Flint that he opposed funding an auto bailout important to Michigan voters.

Sanders debuted a one-minute radio ad Monday accusing Clinton of “trying to distort the truth about Bernie’s record” and saying the senator from Vermont “has always been on the side of Michigan workers and working families.”

Sanders made the same argument during a series of rallies Monday in Michigan, telling an Ann Arbor crowd of more than 5,700 that “of course I voted to defend the automobile industry.”

During the debate Sunday, Clinton said that there was “a pretty big difference” between the two candidates on a $14 billion auto rescue package that was of particular interest to voters in Michigan, as well as in Ohio.

“I voted to save the auto industry,” Clinton said during the debate. “He voted against the money that ended up saving the auto industry.”

Left unmentioned was a 2008 Sanders vote in favor of an auto bailout. The vote that Clinton referenced was on 2009 legislation to release money for a Wall Street bailout, some of which was used to help auto manufacturers.

“I was very disappointed the other night in the debate, when Secretary Clinton suggested I was not supportive of the automobile bailout,” Sanders said Tuesday as he left Michigan. “That is absolutely untrue. Of course I supported those workers. It’s unfortunate that Secretary Clinton tried to imply otherwise.”

Phillip reported from Cleveland.