At a rally in Columbia, S.C. on Feb. 27, Democratic presidential candidate Hillary Clinton thanked supporters. (Sarah Parnass/The Washington Post)

Hillary Clinton easily defeated her rival, Sen. Bernie Sanders, in the Democratic primary here Saturday, the first broad test of whether the strong challenge from Clinton’s political left has eroded crucial support among African American voters.

With the victory in South Carolina, Clinton can claim a powerful advantage among black voters who could determine the outcome in a half-dozen Southern states that vote next.

For Clinton, this was the first comfortable victory of a Democratic primary season that just a year ago was supposed to be comfortable from end to end, with Clinton waltzing through as a front-runner.

Instead, Sanders — the senator from Vermont who calls himself a democratic socialist and has electrified young voters and white liberals — beat Clinton handily in New Hampshire and came unexpectedly close to beating her in Iowa and Nevada.

The victory in South Carolina will give Clinton momentum as the contest heads toward Super Tuesday, where she and Sanders will compete in 11 states.

Hillary Clinton won the South Carolina Democratic primary on Feb. 27. Here's how. (Peter Stevenson/The Washington Post)

A slightly hoarse Clinton came out to cheers of “Hillary! Hillary!” in a room full of jubilant supporters in Columbia.

“Today, you sent a message: In America, when we stand together, there is no barrier too big to break,” Clinton said. Acknowledging that South Carolina was the end of the one-state-at-a-time early phase of this campaign, she exclaimed: “Tomorrow, this campaign goes national!”

Exit polls reported by ABC News showed that Clinton’s advantage with black voters was, indeed, decisive: Black voters accounted for about 6 in 10 of Saturday’s Democratic electorate, and an overwhelming 8 in 10 of those black voters supported Clinton.

That would set a record. The previous record was 55 percent, set in 2008 as then-Sen. Barack Obama campaigned — against Clinton herself — to become his party’s first African American nominee.

Minutes after the polls closed, Clinton changed her Twitter profile picture to a poster-style drawing of her with the words “Thank You South Carolina.”

Sanders was in the air when the race was called for Clinton, flying from one campaign stop in Texas to another in Minnesota.

“In politics, on a given night, sometimes you win, sometimes you lose. Tonight we lost,” Sanders told reporters after getting off his chartered jet in Rochester, Minn., where he was staging an evening rally. “I congratulate Secretary Clinton on her very strong victory. Tuesday, over 800 delegates are at stake, and we intend to win many, many of them.”

He did not take questions before getting in his car.

Sanders has won only one of the four initial contests, where candidates typically focus the greatest attention and resources. But he has captured young voters in astonishing numbers and is raising more money than Clinton, ensuring that he will remain in the race — and remain a threat to the front-runner.

Sanders was already looking ahead to states that vote on March 1, Super Tuesday. His campaign has said it has a good shot of winning five of the 11 Democratic state contests that day.

He spent much of the last few days before Saturday’s vote campaigning in Super Tuesday states, and although he began the day in South Carolina, he left in the morning and never returned.

Clinton spent most of the last week in South Carolina, leaving only for brief stops in Super Tuesday states including Texas and Georgia.

A thousand miles from South Carolina in Austin on Saturday, more than 10,000 adoring Sanders supporters showed up and cheered his every sentence at an outdoor rally. He had plenty to say about elections — just not the one taking place Saturday.

He recounted his near tie in the Iowa caucuses, his big win in the New Hampshire primary and his come-from-behind five-percentage-point loss in Nevada.

“And now we come to Super Tuesday!” Sanders said, skipping over South Carolina’s place on the calendar.

Sanders could not make much headway against Clinton’s long ties and enduring loyalty among many black voters here. He had hoped to do well enough to claim he had dented Clinton’s “firewall” of Southern states, which Clinton allies have claimed would put an end to Sanders’s early momentum from liberal, majority-white states.

But unlike in Iowa, New Hampshire and Nevada, Clinton’s once-impressive double-digit lead over Sanders never faltered much in South Carolina. With nearly all precincts reporting, Clinton was beating him by nearly 50 percentage points — by far the largest margin for any victory so far this year.

Clinton sent surrogates including Rep. James E. Clyburn (D-S.C.) — the top-ranking black Democrat in the House — to polling places to make one last pitch. In many places, it seemed that the voters didn’t need it: Black voters, especially, praised her long experience in Washington.

“We’ve made a lot of progress in the last eight years, and Hillary is the best person out there to continue the progress,” said Al Tucker, a 67-year-old African American in Columbia, the state capital. “You look at South Carolina, and we’re at the bottom in anything you can think of: education, poverty. I think Hillary would be good because she’s going to look out for us.”

A majority of black voters this time said they saw Clinton as trustworthy and honest — a marked change from New Hampshire, where she lost badly amid voter concerns about her honesty.

The same exit polls showed that Sanders had vastly beaten Clinton among white voters younger than 45, but there were many fewer of these voters in the South Carolina primary than in other early states. Additionally, according to ABC News, Clinton dominated in a demographic that Sanders had hoped to win in this state: black voters younger than 45. Clinton won that group by 3 to 1. Clinton won by a narrow margin whites who were 45 and older, and she won nearly all of the vote among blacks 45 and older, according to ABC News.

In recent weeks, Clinton has largely shifted her focus away from the Republican race toward the threat that Sanders poses to her in the Democratic primary season. But on Saturday, Clinton reiterated her criticism of the rhetoric of Republican front-runner Donald Trump, particularly toward Muslim Americans.

During a stop in Birmingham, Ala., the former secretary of state took an implicit swipe at Trump.

“When you run for president, it’s not just Americans who pay attention. And when you are president the entire world listens to every word you say. Markets rise and fall,” Clinton said. “You do have to be careful about what you say and how you say it.”

Exit polls reported by ABC News also showed that a large majority of Democratic voters, fully 7 in 10, wanted the next president to continue Obama’s policies, rather than pursue a more liberal agenda. Sanders has called for a “political revolution” that would enact sweeping liberal policies — including universal, government-run health insurance — beyond what Obama has put in place.

Sanders began showing up in the state in 2014, long before he announced a run for president, said South Carolina Democratic Party Chairman Jaime Harrison. He ended up with about 200 staff and 11 offices in the state, and his campaign spent roughly $1.7 million on television and radio advertising in the state.

Clinton relied on decades of relationships between her family and black leaders here. Supporters at her rallies and other public events last week were largely older African Americans. Many of those same supporters had spurned Clinton in 2008 to support then-rival Obama.

Some of those South Carolina voters had a falling out with the Clintons, who were accused of using racially tinged rhetoric to disparage Obama’s candidacy eight years ago. But both Hillary and former president Bill Clinton were redeemed with stalwart black support this time around.

Among those supporters was Bernice Scott, 71, who was up early Saturday morning, heading to the small towns around Richland County, where she has lived for nearly 50 years, to help get out the vote for Clinton. As one of the first African Americans to serve on the county council, Scott is well-known and well-respected, a leader of a network of grass-roots activists known as the “Reckoning Crew.”

“Because if you don’t do right, you will have to reckon with us,” Scott said.

“And we are a force to be reckoned with,” adds her friend and fellow crew member, Jackie Brown.

Phillip reported from Columbia, Birmingham, Ala., and Charleston. Wagner reported from Columbia, Austin, Grand Prairie, Tex., and Rochester, Minn. Gearan reported from Washington. David A. Fahrenthold and Vanessa Williams in Washington and Hannah Jeffrey in Columbia contributed to this report.