This was supposed to be the Year of Sino-Japanese Friendship, but rather than celebrating the 40th anniversary of normalising relations, the two nations have derailed bilateral relations over disputed islands in the East China Sea known as Senkaku in Japan and Diaoyu in China. This test of wills is a high stakes contest and the longer Beijing and Tokyo glower at each other and escalate rhetorical exchanges, the greater the mutual economic damage and the harder it will be to negotiate a modus vivendi. As the problem is not going away anytime soon, managing this dispute and containing flare-ups is crucial.

This territorial scrap previously flared up in 2010 when a Chinese fishing trawler rammed a Japanese Coast Guard ship in waters near the islands. The arrest of the crew led to Beijing withholding exports of rare earth minerals vital to various high-tech industries in Japan. These sanctions forced Tokyo to capitulate and release the arrested fishermen, but sparked anti-Chinese antagonism and eroded trust. The incident also triggered widespread protests in China that targeted Japanese businesses. It also inflamed lingering resentments in China over history—December marks the 75th anniversary of the Rape of Nanjing—and stoked mutual suspicions.

In the latest confrontation, Beijing has again shown considerable willingness to escalate tensions despite the clear risks of brinksmanship. Yet again, protests all over China battered bilateral relations. The sabre-rattling has grown more ominous against the backdrop of a political transition in Beijing and pending national elections in Japan.

Domestic politics in both countries limits the room for compromise and diplomatic manoeuvring as both sides are framing this as a zero-sum game. Tokyo asserts that there is no territorial dispute because it exercises administrative control over the rocky outcrops. The Liberal Democratic Party (LDP), the main opposition party, elected the hawkish Shinzo Abe as its president in September and he has staked out a hard line on this dispute. Abe previously served as premier in 2006–07 and many pundits are predicting he has a good chance to regain power in elections that must be held by the summer of 2013.

China has raised the stakes and limited room for diplomacy by declaring the islands “sacred territory”. In the UN General Assembly Chinese Foreign Minister Yang Jiechi asserted, “The Japanese move is a gross violation of China’s territorial integrity and sovereignty, an outright denial of the outcomes of victory of the world anti-fascist war, and a grave challenge to the post-war international order.”

In this context, it is difficult for either side to make concessions. Beijing is passing the baton of leadership at a time when the economy is slowing and there is growing discontent with corruption, nepotism, and income disparity. Beijing clamped down on demonstrations, but more out of fear they might morph into anti-government protests than a gesture of goodwill.

The temptation of patriotic blustering is hard for either side to resist, but in this dangerous game both countries have a lot to lose. There is a serious risk of miscalculation for each that could cause this scrap to spiral out of control. It doesn’t take much to make a martyr and if there were blood in the water, stability in Asia would be at risk. There is little to be gained from aggravating a dispute that has now assumed symbolic importance as a test of wills. Tokyo–Beijing relations are fragile and, in this case, the volatile combination of overlapping territorial claims, competition for seabed resources, strategic ambitions, nationalism, and unresolved historical grievances have elevated these remote outcrops into the focal point of bilateral relations.

The rapid rise of China has lead to a tectonic shift in East Asian geopolitics and the decline of Japanese influence. This abrupt and far-reaching shift in the balance of power is destabilising because it challenges the status quo. The rising tide of Chinese nationalism finds a familiar and handy target in Japan and Japanese conservatives do their nation no favours by provoking historical grievances with Asian neighbours.

Governor Shintaro Ishihara of Tokyo has a lot to answer for. In April he announced plans to purchase three of the disputed islands from their private owner in Japan and raised over $15 million from public donations to do so. His intent was to provoke China, and, on that score, he has succeeded; Beijing has been fuming ever since. This is Ishihara’s doozy of an own goal, driven by a nationalist agenda and contempt towards China. His plan forced the central government to buy the islands in order to manage the situation and prevent him from doing further damage. But in doing so, Tokyo triggered the current altercation. Ishihara managed to shift Japanese politics to the right, as political contenders try to outdo each other in nationalistic grandstanding.

The media frenzy is whipping up negative perceptions on both sides and a new generation in both countries is learning to hate and vilify.

Can the economic relationship remain insulated from political upheaval? This is the multi-billion-dollar question leaders should be asking because Japan is a leading investor and source of technology, while China is Japan’s largest trading partner. The islands in question are not worth all the damage they are causing, but that is precisely the point. This issue has become dangerously politicised and cost-benefit analyses, or legal arguments appear unpromising.

Japanese companies are reducing production and investments in China in anticipation of a boycott of Japanese products by Chinese consumers whipped up into a patriotic frenzy by a febrile media. But there are also signs that despite the posturing, both sides remain pragmatic; high-profile business leaders from Japan did attend 40th anniversary commemoration events even as diplomatic celebrations were cancelled or scaled back.

Can calmer heads prevail? Probably. Both sides appear to be carefully edging away from the abyss, but a disastrous turn of events and violent clashes remain possible. There must be a cooling-off period, and the political transitions might be an opportunity to hit the reset button. The last time Abe was premier, his first overseas trip was a fence-mending visit to Beijing necessitated by prime minister Junichiro Koizumi’s six visits to Yasukuni Shrine between 2001–06, a talismanic ground zero for unrepentant glorification of Japan’s wartime actions.

To move beyond the impasse, Beijing and Tokyo need to engage in talks about the disputed territories without preconditions, agree to refrain from violence in pursuit of rival claims, and move towards confidence building measures (CBMs) that sidestep the issue of sovereignty. The most ambitious of these CBMs would be joint development of East China Sea seabed resources as specified in a 2008 accord.

In 1978 Deng Xiaoping suggested that this dispute be put aside, placing faith in the wisdom of future generations to overcome the stalemate. One can only hope pragmatic leaders on both sides will find similar wisdom and act on it to avert catastrophe.