It's no secret that China's rise as an economic power has been miraculous. Over the past few decades, hundreds of millions of people have been lifted out of poverty, BMWs have replaced many bicycles on the streets of Beijing, and China's is now the second-largest economy in the world.

This economic explosion has in turn boosted the fortunes of China's regional neighbors and trading partners — but they're not entirely happy about China's newfound power. Because in addition to having the world's second-largest economy, China is also the second-largest spender on arms in the world — with a military to match.

Neighboring countries feel they're being pushed around by an aggressive Chinese foreign policy, and as a result, they're continuing to beed up their own militaries. And it's Japan, China's historical rival, that is quietly providing assistance to many countries that — like Japan itself — are feeling the heat from China.

China shares a land border with more countries than any other nation on earth — and it has territorial disputes with almost all of them: Afghanistan, Bhutan, India, Kazakhstan, North Korea, Kyrgyzstan, Laos, Mongolia, Myanmar, Nepal, Pakistan, Russia, Tajikistan, and Vietnam. (On top of that, separatist movements in Tibet and Xinjiang are pushing for the regions to secede from China.) Most of the border disputes have remained more-or-less dormant for decades.

In 2009, China presented a map with nine dashes snaking through the South China Sea, which boasts rich fisheries and abundant reserves of oil and natural gas. The so-called "Nine Dash Line" or "Cow's Tongue" — the line resembles the outline of, you guessed it, a cow's tongue — staked China's claim on up to 90 percent of the South China Sea, including territory already claimed by the Philippines, Brunei, Taiwan, Indonesia, Malaysia, and Vietnam.

China soon grew belligerent about its territorial claims. Exactly why this happened is a mystery. It started with the Diaoyu Islands in the East China Sea — known as the Senkaku Islands in Japan. China suddenly asserted its claim with visits by Coast Guard and fishing vessels.

Earlier this year, China turned its attention to the Philippines and the Ayungin Shoal, pressing its claim with more Coast Guard ships and by parking the Haiyang Shiyou 981 oil rig, owned by the state-run Chinese National Offshore Oil Company, off the coast of Vietnam inside Vietnam's exclusive economic zone, established by a 30-year-old UN convention. Soon Chinese warships and combat aircraft were sighted in the area.

This trend line isn't good for China's neighbors. China's military continues to grow alongside the boldness of its territorial claims. Between 2004 and 2014, every one of China's Pacific neighbors, with the exception of Japan, minimally doubled the amount it spends on defense. Many countries turned to the United States to gear up, but they also started buying from a much closer and highly unlikely neighbor: Japan.

Unlikely for two reasons. First, many Asian countries are not historically very fond or trusting of Japan. The country's war crimes in many parts of Asia committed mostly during the first half of the 20th century resulted in millions of deaths. Despite Japan's later apologies and financial compensation, many of its neighbors remained wary, and Japan has often been used as a bogeyman for nationalist purposes.

In the aftermath of World War II, Japan adopted a national constitution that enshrined pacifism. Article 9 of the constitution banned war as a tool of government, and one of the offshoots of that was a policy banning the sale of arms to pretty much everybody. So while Japan became an exporter of a lot of things, weapons weren't really one of them. The current government of Prime Minister Shinzo Abe, however, loosened the ban to allow weapons to be sold to friendly countries — a move that he no doubt hopes will boost Japan's ailing economy.

After decades of neglect, the Philippines is rebuilding its air and naval forces. It's receiving 10 patrol ships from Japan, along with satellite communications equipment. The ships, of course, will be used to patrol the area in dispute with China. The Philippines is also buying a dozen FA-50 fighter jets from South Korea, and acquiring old US Coast Guard cutters.

Vietnam and China have been enemies for thousands of years; the two countries most recently fought a two-week, incredibly bloody war in 1979. In response to China's buildup, Vietnam's defense spending has nearly quadrupled over the last 20 years. Japan is set to donate several retired Coast Guard vessels to Vietnam. And in 2009, Vietnam blew its entire defense budget on six Improved Kilo-class submarines from Russia. So far, three of the submarines have been delivered.

Vietnam had never even had submarines before, but it feels the need now because of its overlapping territorial claims in the South China Sea with China. India, which maintains similar submarines, is helping train the crews.

India shares a border with China, and in 1962 the two fought a brief war over contested territory in the Himalayas, where tensions have again been rising recently. India has been stepping up cooperation with Japan, and there is talk of India buying Japanese seaplanes.

Australia, which counts itself an Asian nation, is also boosting air and naval forces. Australia will be a customer for America's F-35 fighter, and is building two small aircraft carriers and three new destroyers. But the most surprising part of Australia's buildup is the impending purchase of 10 _Soryu_-class attack submarines from Japan, which will be the largest sale of weapons by the country since the end of WWII.

The Soryu class is one of the best non-nuclear powered submarines in the world. They will be used to replace Australia's homemade _Collins_-class submarines, which by all accounts have been riddled with problems since their introduction 20 years ago.

So does all of this shopping mean these countries now view China as an enemy? It's more complicated than that. A lot of them do a good deal of trade with China. So for countries like Vietnam and Japan, China is both an economic partner and a military rival. Weeks after worries that Vietnam and China appeared as though they might come to blows over the Haiyang Shiyou oil rig, Vietnam dispatched an envoy to China to patch things up.

But Japan will no doubt keep on selling. Japanese military equipment, while untested in battle, is well-made and often technologically on par with US equivalents. Japan is likely to offer generous credit terms to its neighbors, both to position itself to capture a large segment of the arms market and to strengthen its diplomatic position in the region. Japan, constrained by an enormous deficit and domestic and constitutional quandaries with national defense, can't quickly expand its military. It can, however, help others expand.

Follow Kyle Mizokami on Twitter: __@KyleMizokami