TEL AVIV — After a bruising campaign focused on his failings, Prime Minister Benjamin Netanyahu of Israel won a clear victory in Tuesday’s elections and seemed all but certain to form a new government and serve a fourth term, though he offended many voters and alienated allies in the process.



With 99.5 percent of the ballots counted, the YNet news site reported Wednesday morning that Mr. Netanyahu’s Likud Party had captured 29 or 30 of the 120 seats in Parliament, sweeping past his chief rival, the center-left Zionist Union alliance, which got 24 seats.

Mr. Netanyahu and his allies had seized on earlier exit polls that showed a slimmer Likud lead to create an aura of inevitability, and celebrated with singing and dancing.

While his opponents vowed a fight, Israeli political analysts agreed even before most of the ballots were counted that he had the advantage, with more seats having gone to the right-leaning parties likely to support him.

It was a stunning turnabout from the last pre-election polls published Friday, which showed the Zionist Union, led by Isaac Herzog, with a four- or five-seat lead and building momentum, and the Likud polling close to 20 seats. 

To bridge the gap, Mr. Netanyahu embarked on a last-minute scorched-earth campaign, promising that no Palestinian state would be established as long as he remained in office and insulting Arab citizens.