Donald J. Trump wrested back control of the Republican presidential race on Tuesday with a commanding victory in the New York primary, while Hillary Clinton dealt a severe blow to Senator Bernie Sanders with an unexpectedly strong win that led her to declare that the Democratic nomination was “in sight.”

The Queens-born, Manhattan-made Mr. Trump was poised to take most of the 95 Republican delegates at stake, substantially adding to his current lead over Senator Ted Cruz of Texas and significantly improving his chances of winning the Republican nomination. Mr. Cruz came away with no delegates, a major setback, while Gov. John Kasich of Ohio had a shot at picking up some in Manhattan and the capital region.

Mrs. Clinton’s decisive victory ended a string of wins by Mr. Sanders and gave her more delegates than her advisers expected. Her base of support was Long Island, the five boroughs, and upstate cities, with female and black and Hispanic voters turning out for her in especially strong numbers.

The two hometown winners beamed throughout their victory speeches, but it was Mr. Trump who particularly seemed like a different candidate. As he spoke in the lobby of Trump Tower, there were no freewheeling presentations of steaks and bottled water, as in the past. There was no reference to “Lyin’ Ted” or “Crooked Hillary”; he called his opponent “Senator Cruz” instead, and made no mention of Mrs. Clinton. He also took no questions from the news media.