TOKYO — President Trump on Saturday began a four-day state visit to Japan that is high on pomp and ceremony meant to underline the strength of the alliance, even as possible trade rifts and regional tensions with North Korea loomed in the background.

The trip, with Japan’s Prime Minister Shinzo Abe as host, has been tailor-made to flatter Trump’s ego. The U.S. president will become the first foreign leader to meet new Emperor Naruhito since he ascended the Chrysanthemum Throne at the beginning of May.

But there are also serious and even contentious issues on the periphery, among them Trump’s determination to get a better deal on trade with Japan, persuading ­Tokyo to pay more for the U.S. military presence here, deadlock with North Korea and rapidly rising tensions with Iran.

“We just spent many, many hours on the plane,” Trump said Saturday evening to a gathering of several dozen Japanese business executives at the U.S. ambassador’s residence, where he headed as soon as Air Force One touched down at Haneda Airport. “We just walked off the plane, and here we are.”

On Saturday, Trump’s national security adviser, John Bolton, said North Korea had clearly violated U.N. Security Council resolutions by testing short-range ballistic missiles this month. He said Trump and Abe would underline the importance of maintaining the “integrity” of those sanctions resolutions. 

Bolton also said North Korea had not responded to attempts by the United States and South Korea to restart talks after the breakdown of a summit between Trump and North Korean leader Kim Jong Un in Hanoi in February.

Trump later appeared to contradict Bolton, tweeting, “North Korea fired off some small weapons, which disturbed some of my people, and others, but not me.” He said he still had “confidence that Chairman Kim will keep his promise to me.”

But if Trump’s North Korea policy is in some disarray, he will at least find a friendly ear in Abe.

More sensitive could be the issue of Iran, after Trump announced Friday that he would be sending an additional 1,500 troops to the Middle East to counter what the administration says are increased threats from Tehran.

Japan has long-standing diplomatic and cultural ties with Iran and opposed the U.S. decision to pull out of the Iran nuclear agreement negotiated under the administration of President Barack Obama. On Saturday, Japanese news media said that a plan was being drawn up for Abe to visit Iran in June to meet President Hassan Rouhani in an attempt to mediate and that this was something Japan’s leader would discuss with Trump.

Abe’s trip would follow a visit to Japan by Iranian Foreign Minister Mohammad Javad Zarif this month.

Abe, who first visited Iran with his father in 1983, has maintained close ties with the Iranian leadership since becoming prime minister. The two countries signed an investment agreement in 2016 and are celebrating 90 years of diplomatic engagement this year.

Akihisa Nagashima, an independent politician and former national security expert, welcomed the news that Abe could be trying to mediate.

“A remarkable face-saving mission,” he tweeted. “This is the ‘realistic solution’ that could save both the face of President Trump, who is finding it hard to deal with Bolton’s hard stance, and that of the prime minister, who’s having difficulty in Japan’s relationship with Russia and North Korea.

“Suddenly, the Japan-U.S. summit, which was seen as having no diplomatic agenda, carries meaning. This is what we call quiet diplomacy.”

Bolton declined to comment Saturday when asked about possible Japanese mediation except to say the two leaders will “certainly discuss Iran.” 

He repeated U.S. accusations that “Iran and its proxies” were behind violent attacks in recent weeks, including on oil tankers and pipelines, adding that the administration is “very concerned about this level of very dangerous behavior by the Iranian regime.”

“The way to preserve peace, the way to prevent Iran from taking belligerent steps, is to have a strong American presence in the region,” Bolton said.

Bilateral issues are also on the agenda. Shortly before leaving, Trump tweeted, “I will also be discussing Trade and Military with my friend, Prime Minister @AbeShinzo.”

Trump has threatened to impose a 25 percent tariff on foreign cars, a measure that would have a serious impact on Japan’s economy, although he recently announced that the measure would be delayed 180 days to allow for talks on ways to restrict import volumes. He also wants Japan to cut its agricultural tariffs.

Speaking at the residence of William Hagerty, the U.S. ambassador to Japan, Trump said the United States and Japan were working to negotiate a bilateral trade agreement but noted what he said was an imbalance between the countries.

“I would say that Japan has had a substantial edge for many, many years, but that’s okay,” he said. “Maybe that’s why you like us so much.”

Japan’s decision to push ahead with the Trans-Pacific Partnership, an 11-nation trade deal, and also its success in agreeing to a separate deal with the European Union, has resulted in promises to cut agricultural tariffs for multiple countries. 

But because Trump withdrew from the TPP, the United States is not one of them, and U.S. exporters of porkwheat and barley are reported to be under pressure.

Trump is also keen to get Japan to pay more of the cost of stationing U.S. troops in the country, although Tokyo says it already covers most of the costs and a higher proportion than other host nations. For the United States, bringing its troops back home would be more expensive, Tokyo says.

Trump will also be the guest of honor at the finals of a sumo tournament Sunday and will present a cup to the winner. The cup, which will be called the “President’s Cup,” is approximately 4½ feet high, is between 60 and 70 pounds and features an eagle on the top, a senior White House official said. The president viewed photos of the cup before he left for Japan, the official added.

On Tuesday, Trump will tour a Japanese aircraft carrier, a flat-top that already carries helicopters but is being converted to carry U.S. short takeoff and vertical landing F-35B fighter jets. The stop is designed to underline Japan’s willingness to help defend itself but also to purchase American military hardware in that effort.

Trump has boasted of the great honor of the “very big event” he is to attend concerning the emperor, “something that hasn’t happened in over 200 years,” even if he does appear slightly fuzzy on the details. 

For the record, the abdication of Naruhito’s father, Emperor Emeritus Akihito, marked the first time an emperor had stood down in more than two centuries, but the only historic event Trump will attend will be a formal banquet with the new emperor.

Japan’s prime minister has invested a huge amount of time and attention maintaining a close relationship with Trump. The pair have spoken by telephone or met in person more than 40 times since late 2016. The summit will be the second of three meetings for them in three months, with Abe visiting Washington in April and Trump due back in Japan for the Group of 20 meeting next month.

On Saturday night, Trump said the U.S.-Japanese relationship has “never been stronger, never been more powerful, never been closer.”

Hagerty, introducing Trump, instructed the business leaders to open a small gift given to each — a glass tumbler — and urged them, after the president’s departure, “to step outside and celebrate with a small afterglow and celebrate the arrival of the president of the United States for the first state visit of the Reiwa era.” 

A Jack Daniels bar had been set up on the patio beside a small pool.

Akiko Kashiwagi contributed to this report.