“Cooperating with you, I’d like to do my best to hand over to our children’s generation a Japan filled with hope and pride,” Mr. Abe said in his acceptance speech.

Above all, analysts said, Mr. Abe’s signature accomplishment is his stable political leadership in a country that had grown weary of a conveyor belt of prime ministers. Since World War II, the average tenure of Japanese prime ministers has been about two years. By the end of next year, Mr. Abe would exceed Mr. Katsura’s almost eight years in office because Mr. Abe’s tenure includes an earlier stint as prime minister.

Critics have been disappointed by Mr. Abe’s entanglement in influence-peddling scandals and his failure to deliver stronger economic growth or the gender equality measures that he has long promised. But his opponent in the party election, Shigeru Ishiba, a former defense minister, failed to generate enough enthusiasm to justify a change of course.

“People may not be wildly excited, but they can’t think of anybody who is going to do any better,” said Sheila A. Smith, a Japan expert at the Council on Foreign Relations in Washington. “Whether it’s the party or it’s the Japanese voter writ large, I think they are pretty risk averse right now, given all the challenges that Japan faces, not the least of which is the Trump administration.”

Next week in New York, Mr. Abe, who has persistently cultivated a cozy relationship with Mr. Trump, is expected to meet with him on the sidelines of the United Nations General Assembly. Mr. Abe could come under pressure to enter bilateral trade talks as the Trump administration mulls threatened tariffs on automobile imports.