Japan lodged a formal protest with the Chinese government on Friday after determining that an unidentified nuclear submarine that entered its territorial waters this week belonged to China.

Japan's navy went on a rare alert Wednesday when the sub was first spotted in Japanese waters between the southern island of Okinawa and Taiwan. The sub spent about two days in Japanese territory before heading north, and Japanese reconnaissance aircraft and naval destroyers pursued the sub for two days in an attempt to identify it.

Officials said Friday there were enough signs to believe the craft was Chinese, including the direction it traveled and the fact that it was nuclear-powered. Tokyo formally protested the incursion with the Chinese Embassy.

"It is extremely regrettable, and we've lodged a protest," said Prime Minister Junichiro Koizumi. "In order to prevent a recurrence, we must know why this happened, and we are awaiting a response from the Chinese."

The Chinese envoy, Cheng Yonghua, was summoned by Foreign Minister Nobutaka Machimura and said afterward that the incident was being investigated. In Beijing, a Chinese Foreign Ministry spokeswoman, Zhang Qiyue, said that "the relevant parties are still trying to understand the situation."

Tokyo has been watchful of increased activity in the region, which lies near a disputed underwater gas field and a cluster of islands surrounded by rich fishing waters jointly claimed by Japan, China and Taiwan.

China has begun surveying the gas fields despite Japan's claims that they extend into its territorial waters near Okinawa.

Japan also has complained of unauthorized activity by Chinese research ships near the islands, known as Senkaku in Japan and Diaoyu in China.