Last month, Japan’s defense ministry requested a record budget of about $51 billion for fiscal 2017. At the top of its security worries: China’s maritime aggression.

Japan has reason to worry. In both the East China Sea and South China Sea, Tokyo faces an increasingly assertive China that looks determined to become an unfettered maritime powerhouse—and is beefing up its naval capabilities accordingly.

China’s moves threaten to disrupt Japan’s economy and erode its sense of security. The South China Sea is not the only sea route, but it offers the cheapest, most direct way for energy supplies from the Persian Gulf (and other commodities from elsewhere) to reach northeast Asia. As a nation with few natural resources, Japan has a clear interest in keeping sea routes open.

With that in mind, Japan is strengthening alliances, spending more on defense, and letting its position be known.

“I am seriously concerned with the continuing attempts to change unilaterally the status quo in the East and South China Sea,” Japanese prime minister Shinzo Abe told Asian leaders at an ASEAN summit in Laos this month.

Vulnerable to disruption

China has been rapidly militarizing in the South China Sea in recent years. That has included establishing bases on artificial islands built atop reefs. Some warn that Beijing wants to turn the sea into a “Chinese lake,” and that it is not far off from creating a “strategic triangle” of bases in the sea that would help it exert more control over the vital waterway.

The South China Sea is the one of the world’s chokepoints for oil and natural gas. Nearly 60% of Japan’s energy supplies pass through the sea, largely from the Middle East nations including Saudi Arabia, the UAE, Qatar, and, increasingly, Iran. Coal from Indonesia also passes through, as does corn, wheat, and barley from Australia and the Black Sea region.

That makes Japan’s economy vulnerable to disruptions, should China ever block shipments through that route, whether in peacetime or in some future conflict.

And conflict isn’t out of the question. China still resents Japan’s wartime atrocities during World War II and believes Tokyo has yet to express enough remorse for its sins. This week an exhibition opened in northeast China focusing on the disposal of Japan’s abandoned chemical weapons in China. According to the Pew Research Center, 81% of Chinese hold unfavorable views about Japan, up from 70% a decade ago. Meanwhile, 86% of Japanese hold unfavorable views of the Chinese, from 71% a decade ago.

It’s hardly surprising, then, that Japan is wary of China potentially controlling a waterway as important as the South China Sea. The building of militarized artificial islands by China in the sea’s Spratly archipelago seems to be a step in that direction. As Yoji Koda, a former vice admiral in the Japan Maritime Self-Defense Force, wrote in the journal Asia Policy in January:

These man-made islands, when fully completed, would provide China with strong footholds in the Spratly Islands for controlling most of the sea lines of communication and for monitoring foreign naval and air activities.

Joining forces against China

One way Japan can help deter this is by backing, assisting, or even joining the US Navy’s “freedom of navigation” operations, with which the US asserts its right to sail through certain waters under international law, even if other nations warn it not to. In May, for instance, the USS William P. Lawrence sailed close to the Spratly archipelago’s Fiery Cross Reef, where China has built a militarized island.

China has warned that such operations are “dangerous and irresponsible” and could end “in disaster.” Yet nations have the right to make “innocent passage” through even territorial waters, which extend out 12 nautical miles from a coast, as per the United Nations Convention on the Law of the Sea (UNCLOS).

In July, an international tribunal made a comprehensive ruling under UNCLOS that invalidated China’s sweeping claim to most of the South China Sea. That claim is based on Beijing’s dubious “nine-dash line,” which the tribunal decided had no legal basis. China responded by vowing to ignore the ruling and trying to discredit the tribunal.

Last week, Japanese defense minister Tomomi Inada, speaking at the Center for Strategic & International Studies think tank in Washington,indicated Japan’s agreement with freedom-of-navigation operations. If the world condoned attempts to change the rule of law, she said, the consequences could extend well beyond the South China Sea.

“In this context, I strongly support the US Navy’s freedom-of-navigation operations, which go a long way to upholding the rules-based international maritime order,” she said (pdf).

Inada indicated that Japan’s Maritime Self-Defense Force would participate in “joint training cruises” with the US Navy in the South China Sea, as well as unilateral and multilateral exercises with regional navies.

Lu Kang, a spokesman for China’s foreign ministry, criticized her remarks this week, saying Japan’s actions regarding the sea “makes one feel disappointed to the point of despair,” and adding that “China is unwavering in its determination to safeguard its territorial sovereignty and maritime rights and interests.”

An editorial in the Chinese state-run Global Times also blasted Inada’s remarks. It suggested that joint US-Japan patrols would be the “gunboat diplomacy of the 21st century,” and that China should respond with military deployments to the Spratly archipelago. If the joint patrols intensified, it said, then China should establish an Air Defense Identification Zone (ADIZ) over the South China Sea, focused on intimidating Japan in particular.

Inada did not say whether Japan would join the freedom-of-navigation operations in some fashion. This summer China warned that Japan would “cross a red line” by doing so, and hinted that the act might lead to military conflict. Given the World War II history and nationalistic sentiment in China, that might be more than just a bluff.

Yet Inada’s comments show Japan might be moving in that direction anyway—meaning the most dangerous flashpoint in the South China Sea could prove to be a Japanese warship, not a disputed islet or shoal.

“Japan’s naval operations may generate far more dangerous scenarios, like direct conflicts between the two navies,” Zhang Baohui, director of the Centre for Asian Pacific Studies at Hong Kong’s Lingnan University, told the Japan Times. “China has done nothing directly against US operations but Japan is a different story. We cannot rule out scenarios of Chinese ships ramming Japanese ones or Chinese ships blocking their passage.”

Even closer to home

Disputes in the East China Sea have also contributed to the increased tension between Japan and its giant neighbor. That sea, unlike the South China Sea, touches Japan’s coast.

In it, Japan’s Ryukyu island chain extends 1,400 km (870 miles) southwest from the Japanese mainland, from Kyushu Island to Taiwan, between China’s coast and the Pacific Ocean. The chain includes Okinawa, where American forces are stationed as part of Japan’s security treaty with the US.

Beijing has long argued that the Japanese-controlled Senkaku Islands, near the Ryukyu chain, belong to China. Rich fishing grounds and large untapped deposits of natural gas surround the otherwise small, desolate islets (which China calls the Diaoyu Islands). The issue has stirred nationalist anger on both sides for years, with each country bolstering its military presence in the area.

In late 2013 China established an ADIZ over the Senkakus and the rest of the East China Sea. Its defense ministry warned that all aircraft entering the zone must notify Chinese authorities, identify themselves, and obey orders. Enforcement proved difficult and fell by the wayside, but China could reinvigorate its efforts in the future, as new infrastructure comes online.

China is building a $544 million military base off its port city of Wenzhou, the nearest place on the mainland to the Senkakus. It’s also built a war ship pier on the Nanji Islands, which are off the coast from Wenzhou and about 100 km (62 miles) closer to the Senkakus than Okinawa. Other facilities in the Nanjis include a heliport and advanced radar equipment that should help China better monitor its ADIZ.

Last month, China sent hundreds of fishing boats—accompanied by a few dozen government ships—near the Senkakus. Japan’s foreign ministry described the act as a unilateral escalation of tension in the area.

In March, Japan opened its own new radar station on Yonaguni island in the Ryukyus, also near the Senkakus. The listening post is part of a larger Japanese military buildup along the island chain to help it monitor activity in the sea.

Building alliances

Faced with a burgeoning maritime power in its longtime rival, Japan is not only reaffirming its strong ties with the United States, but also building alliances elsewhere. In Southeast Asia, it’s helping strengthen the relatively weak maritime forces of nations bordering the South China Sea, and has provided patrol ships to both Vietnam and the Philippines, for example.

But Japan, of course, can’t control or predict how other nations will behave. Last week Philippines president Rodrigo Duterte moved closer to Beijing and further from the US and its allies. He announced his nation would not be involved in joint patrols in the sea, notably ones with the US Navy. He also instructed his defense ministry (paywall) to start buying military hardware from China and Russia.

Japan has an ally of sorts in Australia. An important three-way alliance has formed between Japan, Australia, and the United States in relation to both seas. After a “Trilateral Strategic Dialogue” in July the three nations issued a statement voicing their “strong opposition to any coercive unilateral actions that could alter the status quo and increase tensions.” What China has been up to, in other words.

Of course Australia’s support for Japan in the East China Sea only goes so far, whereas US president Barack Obama reiterated in April that the US, as part of the security treaty, would come to Japan’s aid in the event of a conflict over the Senkakus.

A dubious claim of its own

Japan is widely perceived to have the superior claim to the Senkakus, and its position on the South China Sea is in line with today’s law of the sea under UNCLOS. But like China, Japan has shown it is willing to ignore that law if it goes against its interest.

A case in point is Japan’s insistence that it is entitled to an exclusive economic zone (EEZ) around Okinotori (“remote bird”) island, an uninhabited atoll in the Philippine Sea.

Under UNCLOS, to be legally defined as an “island” a feature must be able to support human habitation and an economic life of its own. If it passes that test, it generates an EEZ of 200 nautical miles, granting the owner sole exploitation rights to the resources of the sea and the seabed, including fish, oil, and natural gas. A “rock” gets just a 12-nautical-mile territorial sea.

In July, the tribunal ruled that every feature in the South China Sea’s Spratly archipelago was at most a “rock.” That included the assortment of manmade islands China has built there in recent years, and also the largest feature of the Spratlys, an islet called Itu Aba.

If Itu Aba isn’t an island, neither is the much tinier Okinotori.

China argues that Okinotori is at most a rock and should under UNCLOS generate only a 12-nautical-mile territorial sea, not an EEZ.Taiwan and South Korea agree with China. So do many legal experts. Japan has argued that the tribunal’s July ruling does not apply to Okinotorishima (“shima” means island). But there’s no clear reason it should not.

“Okinotorishima stands as the Achilles’ heel in Tokyo’s credibility to take a harder position against China in the South China Sea,” Jeffrey Hornung, an Asia expert with the Sasakawa Peace Foundation USA in Washington, told the Japan Times. “It is simply too hard to ignore the hypocrisy.”

Japan has spent hundreds of millions of dollars trying to bolster Okinotori, including by fortifying parts of it with concrete and steel and even transporting baby corals grown in a lab to the atoll. Last year Shintaro Ishihara, then Tokyo governor, staged a photo op at Okinotori. The photos showed the hawkish politician waving a Japanese flag—and fanning, no doubt, the flames of Chinese anger.

Article 9 revisited

Even at over $50 billion, the defense budget of Japan is still dwarfed by those of the US and China. And Japan’s constitution still explicitly renounces war, notably in Article 9:

Article 9. Aspiring sincerely to an international peace based on justice and order, the Japanese people forever renounce war as a sovereign right of the nation and the threat or use of force as means of settling international disputes. In order to accomplish the aim of the preceding paragraph, land, sea, and air forces, as well as other war potential, will never be maintained. The right of belligerency of the state will not be recognized.

The public is mostly against the idea of revising that clause, but for prime minister Abe, it has long been a goal. Elections in July gave his Liberal Democratic Party more than two-thirds of the seats in parliament, a supermajority that could help him change the constitution and make Japan a major military power once again.

Whether he succeeds or not, the maritime tension between China and Japan looks set to intensify even more.