Japanese Prime Minister Shinzo Abe and his British counterpart Theresa May agreed Wednesday in Kyoto to work together to counter the "unprecedented" security threat from North Korea following the launch of a ballistic missile over Japan the previous day.

May arrived in Japan on Wednesday afternoon for a three-day visit, her first to the country since taking office in July last year. She is expected to stress her unity with Abe over North Korea and discuss the future of bilateral economic and trade ties.

Ahead of formal talks scheduled for the following day in Tokyo, Abe and May affirmed over dinner in Japan's former capital that North Korea's provocative actions now present "an unprecedented grave and serious threat and absolutely cannot be tolerated," according to the Japanese Foreign Ministry.

They agreed to work in coordination to put more pressure on North Korea, including at the United Nations, and to urge China to play a greater role in the matter, the ministry said.

The dinner talks were preceded by a tea ceremony in Kyoto following May's arrival at Osaka International Airport.

British PM May lands in Japan to talk N. Korea, trade with Abe

At their meeting on Thursday, the leaders are expected to announce a set of joint statements pledging cooperation on security and the economy.

They are expected to discuss in Tokyo how their countries' trade relationship might evolve once Britain completes its exit from the European Union.

Japan and the European Union sealed a broad agreement last month on a free trade deal that analysts said served as a signal to skeptics about the benefits of staying in the bloc.

May will also attend a meeting of Japan's National Security Council to be held Thursday afternoon ahead of the bilateral talks, according to the Japanese government.

Such an invitation has previously been extended just once, to then Australian Prime Minister Tony Abbott in 2014. Abe and May agreed in April this year to advance joint defense exercises and equipment research.

Prior to the meeting between Abe and May, the foreign and defense ministers of Japan and Britain agreed in separate telephone talks to further pressure North Korea over its missile development and deepen bilateral defense cooperation.

According to the Japanese Foreign Ministry, British Foreign Secretary Boris Johnson told his Japanese counterpart Taro Kono that he shares Japan's concern over North Korean missiles and vowed to cooperate with Japan at the U.N. Security Council and elsewhere.

On Thursday morning, May is scheduled to visit the Maritime Self-Defense Force's Yokosuka base in Kanagawa Prefecture, southwest of Tokyo.

She is also set to meet with Emperor Akihito before leaving Japan on Friday.

Britain PM May arrives in Japan