Japanese Prime Minister Shinzo Abe and German Chancellor Angela Merkel on Monday championed free trade amid rising protectionist sentiment in some parts of the world and agreed to step up cooperation in tackling new security challenges.

"Japan and Germany will closely work together to maintain and strengthen a free and open economic system," Abe said in a joint press conference after their talks in Tokyo.

The meeting between the leaders of the world's third- and fourth-largest economies came on the heels of the entry into force Friday of a free trade agreement between Japan and the European Union, with Merkel saying the accord covering about a third of the global economy will "send an important signal to the world."

The two leaders said they agreed to support the development of self-driving car, artificial intelligence and other cutting-edge technologies.

As part of efforts to expand security cooperation, Abe and Merkel broadly agreed on a pact aimed at facilitating the exchange of classified information, including in the field of terrorism.

"This agreement will be helpful in cybersecurity cooperation as both our countries are facing the same challenges," Merkel said.

Japan has similar deals with Australia, Britain, France, India, Italy, South Korea, the United States and the North Atlantic Treaty Organization.

Abe and Merkel, who intends to step down as chancellor in 2021 after 16 years in power, also discussed regional issues, including China, North Korea and Russia.

"It is very significant that Japan and Germany agreed to work together toward the realization of a free and open Pacific," Abe said.

Merkel expressed concern over China's territorial ambitions in Asia, while stressing the need for working closely with Beijing in various areas.

On Russia, Abe explained his recent talks with President Vladimir Putin toward concluding a bilateral postwar peace treaty, but Deputy Chief Cabinet Secretary Yasutoshi Nishimura, who briefed reporters after the meeting, declined to elaborate further.

Britain's exit from the 28-member European Union, of which Germany is a leading member, was also one of the topics of their talks.

The shape of Brexit remains unclear, with Britain's House of Commons voting late last month to reopen negotiations with the regional bloc over the departure deal, under which the country is scheduled to leave the bloc on March 29.

In the news conference, Abe said he told Merkel that a no-deal divorce should be avoided as it would have a negative impact on the global economy, given that a number of Japanese companies are operating in Britain.

Merkel, who came to Japan for the first time in about three years, said Germany is making all-out efforts to avoid such an outcome and the issue will not advance without hearing from Britain what it wants.

They confirmed their cooperation for the success of a Group of 20 summit in late June in the western Japan city of Osaka, which Abe will chair and Merkel is likely to take part in.

On Tuesday, the German chancellor is scheduled to have an audience with Emperor Akihito, who will abdicate on April 30, and Crown Prince Naruhito, who will succeed him on May 1, before leaving Tokyo in the afternoon.