OSAKA, Japan — President Trump plunged back into the world of international diplomacy on Friday with characteristic provocation, keeping some of America’s closest allies, including his hosts, off balance even as he sought advantage on an array of economic and security disputes with profound consequences.

Mr. Trump opened a series of high-stakes meetings with world leaders gathered in Osaka, Japan, for an international summit meeting after calling into question the very foundation of the relationship between the United States and two of its most important friends, Japan and Germany, and lashing out at a third partner, India.

The Japanese leaders hosting the meetings were still reeling Friday morning at the president’s attack on the mutual defense treaty that has been the bedrock between Washington and Tokyo for nearly seven decades.

Before arriving in Osaka, Mr. Trump complained that under the treaty, Japan would not come to the aid of the United States if it were attacked and instead would “watch it on a Sony television.”