Donald J. Trump and Hillary Clinton barreled toward a general election showdown Tuesday night as they dominated primaries in Pennsylvania, Maryland and other Eastern states, piling up enough delegates to close in on their parties’ nominations.

Looking past their fading rivals, the two even taunted each other in dueling election-night events. Clinton chided the Republican’s penchant for harsh language by saying that “love trumps hate.” Trump was more bluntly dismissive of Clinton, saying her appeal boiled down to her gender.

“Frankly, if Hillary Clinton were a man, I don’t think she would get 5 percent of the vote,” Trump said.

Trump had the more convincing performance Tuesday: He swept all five primaries, defeating Sen. Ted Cruz of Texas and Gov. John Kasich of Ohio by about 30 percentage points or more. His routs represented a breakthrough: He received more than half the vote in every state, after months of winning most primaries by only pluralities.

The big night for Trump and Clinton intensified the aura of inevitability around their nomination bids and created urgent challenges for their rivals. More significant, it increased Trump’s chances of avoiding a fight on the floor of the Republican convention in July and of claiming the nomination on the delegates’ first ballot.

“When the boxer knocks out the other boxer, you don’t have to wait around for a decision,” he said boastfully at an election-night appearance before supporters at Trump Tower in New York. He added: “As far as I’m concerned, it’s over.”

Cruz and Kasich fared so poorly Tuesday that together they were likely to win just 10 of the 118 bound delegates up for grabs. Rhode Island, Connecticut and Delaware also went for Trump, who was on track to bring his total to about 950 of the 1,237 needed to clinch the nomination outright.

Cruz is now under growing pressure to beat Trump in Indiana’s primary next week, perhaps the last real chance the stop-Trump forces have to halt his march to the nomination. He and Kasich forged an alliance to thwart Trump in Indiana, but it has yet to show signs of working.

Even before polls closed in the East on Tuesday night, Cruz tried to pre-empt the rush of coverage about Trump’s dominance.

“Tonight this campaign moves back to more favorable terrain,” Cruz told supporters in the Knightstown, Indiana, gymnasium where the high school basketball movie “Hoosiers,” about underdogs who triumph over a big-city rival, was filmed.

On the Democratic side, Sen. Bernie Sanders won only the primary in Rhode Island and fell further behind Clinton in their race to amass 2,383 Democratic delegates to clinch the nomination. Clinton advisers predicted late Tuesday that she was poised to net roughly 50 more pledged delegates than Sanders, out of 462 up for grabs, adding to her lead of about 240 going into the primaries.

Clinton advisers said Tuesday’s final delegate tally would reveal not if, but when, Clinton would win the nomination: either in early June, if she continues at her current pace, or as soon as the Kentucky and Oregon primaries May 17, if she does better than expected in the coming weeks, once her support from more than 500 superdelegates is included. Superdelegates could switch their votes at any point, but Clinton’s are widely considered to be staunch supporters.

Clinton predicted that she would return to Philadelphia this summer for the Democratic convention “with the most votes and the most pledged delegates.”

She pledged to heal the party’s wounds after a long nomination fight, telling Sanders supporters that “there is much more that unites us than divides us.” But she also looked past Sanders to take a swipe at Trump and his campaign motto, “Make America Great Again.”

“Despite what other candidates say, we believe in the goodness of our people and the greatness of our nation,” Clinton said.

Sanders, speaking Tuesday night to an audience of 6,500 people in West Virginia, which votes May 10, said emphatically that he would stay in the race. He made an unusually pointed appeal to superdelegates, arguing

that he had won more votes from independents and from Republicans than Clinton and would be a stronger general election candidate.

After the rally, however, Sanders issued a statement saying he would go to the Democratic convention in July “with as many delegates as possible to fight for a progressive party platform” — a remark that some Democrats interpreted as his first acknowledgment that he would not attend the convention as the nominee.

Still, for all his fortitude, Sanders plans to reassess his candidacy Wednesday and decide whether to adjust his strategy if Clinton’s delegate lead appears all but insurmountable. His senior strategist, Tad Devine, said the Sanders team would discuss a range of issues including how to adjust messaging about the nominating process and what route if any there is to winning it. Devine said he could still see a mathematical path to securing the nomination but added that, if it changed, the campaign would have to adjust.

“If we are sitting here and there’s no sort of mathematical way to do it, we will be up front about that,” Devine said Tuesday.

The broad support for Trump spanned some of the dividing lines that have characterized the Republican race until now: He won among the affluent and college-educated as well as with blue-collar voters and those with no more than a high school education, according to exit polls.

But the unease about Trump’s candidacy in some quarters of the party persisted, a potential warning sign if he emerges as the nominee. About a quarter of Republican primary voters in Connecticut, Maryland and Pennsylvania said they would not support him if he were the party’s nominee. The resistance to Trump was greatest among Kasich’s supporters, who are more moderate-leaning: Six in 10 said they would not vote for Trump in November.

Clinton was lifted once again by strong backing from blacks and older voters, but she also ran stronger with white voters than she has in many states. In Pennsylvania, she narrowly won among whites. Her performance was even better in Maryland, where she carried white voters by 12 points.

Trump’s advantage across all five states was so forbidding that Cruz abandoned the Northeast entirely Saturday, and Kasich was left to pick up stray delegates. Clinton and Sanders campaigned aggressively in Pennsylvania and Connecticut, but they focused largely on policy issues like fracking, gun control and Wall Street reform rather than sniping at each other as they did in a raucous televised debate in Brooklyn.

Not only did Trump have significant prospects for a substantial delegate haul Tuesday, a week after his dominating performance in New York, he also had the opportunity to send a clear message to party leaders and other Republicans that resistance to his nomination is futile.

Trump’s path toward a delegate majority becomes far clearer if Cruz is unable to defeat him in Indiana. That is why Cruz left Pennsylvania on Saturday to head to Indiana, and he plans to campaign there as aggressively as he has anywhere since the Iowa caucuses, where he scored a surprise victory.

The stakes for Cruz are so high that, within political circles, speculation has been swirling this week that he would try to change the subject from his latest losses and announce his pick for vice president before the primary in Indiana. Cruz advisers were cagey about whether he would take such an extraordinary step in an effort to win Indiana, where polls last week put Trump ahead. But the advisers did not dismiss the possibility, an indication that they were thinking about such a move, wanted to keep the speculation alive, or both.

But Trump has no intention of giving Cruz the opening in Indiana he so plainly needs. He planned a rally Wednesday night in Indianapolis with a beloved figure in the state who has also been known to speak his mind and find controversy: Bobby Knight, the former Indiana University men’s basketball coach.

The two Democrats have also been eyeing Indiana, with Clinton campaigning there Tuesday.

Clinton narrowly beat Barack Obama in the Indiana primary in 2008, winning support from a sizable majority of white voters — who made up nearly 80 percent of the electorate in that primary — while Obama won about 90 percent of the black vote. In the 2016 primaries and caucuses, Sanders has often beaten Clinton among white voters, especially white men, and he also performs well with independents, young people and college students, all of whom were expected to be forces in Indiana.

“While our area has lost a lot of good-paying manufacturing jobs, and Sen. Sanders has a way of tapping into that, I think Democrats are ready to rally around Mrs. Clinton and help her get ready to take on Trump and the Republicans” said Dennis Tyler, a Clinton backer who is mayor of Muncie, Indiana, in a county Clinton carried eight years ago.

Sanders advisers have been steadily optimistic about Indiana, but they also acknowledged that a victory there would not matter much if Sanders fell even further behind Clinton in the race for delegates. “If we do,” said Devine, the senator’s strategist, “we may have to go back to the drawing board.