Hillary Clinton swept to four primary victories over rival Sen. Bernie Sanders Tuesday night in a showing that makes her the all-but-certain Democratic presidential nominee.

Mrs. Clinton’s chief task now shifts from winning more states to unifying a fractured party and persuading supporters of Mr. Sanders to coalesce behind her. Her first step appeared to be turning down the rhetorical temperature, giving Mr. Sanders’s supporters space to move in her direction.

Mrs. Clinton took Pennsylvania, Maryland and Connecticut, the three largest prizes of the evening, as well as Delaware, while Mr. Sanders pulled off a win in Rhode Island.

Ahead of Tuesday’s contests, Mrs. Clinton had already amassed a nearly insurmountable delegate lead. But so far, the Sanders campaign is showing little sign it is ready to step aside and make it easier for her to capture the nomination. The race has exposed deep fissures between Sanders and Clinton backers rooted in age, race and ideology, as Mr. Sanders built a passionate following among young, white, liberal voters.

A new poll shows Mr. Sanders is the most popular person in the race in either party among young voters. The Harvard Institute of Politics survey showed that among 18-to-29-year-olds, 54% viewed him positively, 31% negatively. Mrs. Clinton, in contrast, was the favorite of African-Americans, centrists and older Democrats. In the Harvard poll, only 37% of young voters viewed Mrs. Clinton in a positive light.