Japan on Wednesday pledged to provide a passenger-cargo ship to Samoa to help the Pacific island nation improve its transportation as part of Tokyo's initiative to realize a free and open Indo-Pacific.

Under an agreement reached during Samoan Prime Minister Tuilaepa Lupesoliai Sailele Malielegaoi's visit to Japan, Tokyo will provide 2.5 billion yen ($23 million) in grant aid to build the ship.

The visit coincided with the Rugby World Cup being held in Japan. Japan is set to play Samoa on Saturday.

"Enhancing connectivity at sea is a priority area for Japan," Prime Minister Shinzo Abe said at a joint press appearance with Tuilaepa following a meeting at his office.

"It is our hope that the new passenger-cargo vessel will contribute to the prosperity of Samoa and other Pacific-Island nations," Abe said.

The grant aid comes at the request of Samoa, a Japanese government official said. The country has been using a multipurpose ship Japan provided about two decades ago to transport passengers and cargo but its aging has become an issue, the official added.

Tuilaepa expressed his appreciation for Japan's continued support for Samoa's development.

"The vessel will contribute significantly to improving Samoa's export capacity with its neighboring countries, strengthen (the) private sector and business links and maintain safe and efficient sea transport between our islands," Tuilaepa said.

During the meeting held only hours after North Korea fired a missile into Japan's exclusive economic zone, Abe and Tuilaepa also discussed North Korea.

The two leaders agreed to cooperate toward realizing North Korea's denuclearization, said Abe.

Japan has placed importance on forging closer ties with Samoa and other Pacific island nations by strengthening regional links via improved transportation and free trade at a time when China is also increasing its clout in the region. Beijing has built close ties with Samoa.

Tuilaepa, who is on a six-day visit to Japan, said he is looking forward to Saturday's rugby match between Samoa and Japan, while Abe wished Samoa good luck.

"Japan's national team has been gathering momentum and I'm confident that we will be able to see an excellent match," Abe told Tuilaepa before they presented each other with the Japanese and Samoan national team uniforms.