Germany and Japan have pursued relatively unassertive foreign policies since the end of World War II, but the vagaries of geopolitics are forcing them to change course in dramatic ways. On Thursday, German leaders announced that Berlin would try to play a larger global role politically and militarily. Meanwhile, Japan has already been gradually normalizing its military and strengthening its regional and global role, but its transformation has accelerated under the premiership of Shinzo Abe.

Though nearly 9,000 kilometers apart, Germany and Japan still share many of the geopolitical constraints that dictated their actions in the first half of the 1900s, culminating for each in defeat, ruin and eventual rebirth. Both emerged en force at the turn of the 20th century, taking established regional and global powers by surprise.

Germany did not unify officially until 1871. Unification was driven by memories of the Napoleonic Wars, during which divided German statelets were overrun by French armies and by the new economic order of the industrial revolution, which favored centralized states with large economies of scale. Over the course of a few years, the quaint and chaotic fragments of the Holy Roman Empire became the most powerful militaristic player in the heart of Europe. The transformation was spearheaded by the economic and military power of Prussia and the iron will of its chancellor, Otto von Bismarck.

Japan modernized spectacularly during roughly the same time period. In the late 19th century, the country shed centuries of feudal rule and self-imposed politico-economic isolation to become the first modern industrial and military power in Asia.

Both countries entered the world stage to the sound of war — and of victory. In 1871, Prussia led a German military coalition into the heart of France, its old enemy, and stormed into Paris, capturing the French emperor. In 1905, Japan defeated the mighty Russian Empire in a dazzling military campaign, staking a colonial claim in Korea and Manchuria.

Relative to the births of other nations, modern Germany and Japan emerged nearly overnight. The suddenness of their appearance and their power created a violent geopolitical shock to the established global order. France, whose primary concern had long been the British, suddenly had to contend with the threat of a larger, wealthier and more populous state to its immediate east. Japan, on the other hand, halted the expansion of one of largest empires in history and helped trigger the 1905 Russian Revolution.

Despite their successes, their strength and spirit did not allay their deep geopolitical insecurities. Japan’s industrial boom rested on the steady flow of natural resource imports through waterways it did not control. Germany’s wide and open territory in the middle of Europe left it vulnerable on two fronts against some of the world’s most powerful nations, namely France and Russia.

Convinced that they would be unable to guarantee their security in the long term, the two countries went on the offensive. Between 1914 and 1945, Japan invaded China and tried to dominate the northern Pacific, while Germany wreaked havoc on continental Europe. They did not achieve their strategic objectives, and they were left ravaged.

Despite their reversal of fortunes, the fundamental strengths of Germany and Japan remained relatively intact, even after both suffered through partition and occupation. What did not survive the war was the martial enthusiasm for expansion that gripped the ethos of both nations before the two World Wars. But as both countries’ industrial and economic power grew again, questions about how to manage their global ambitions with their tenuous strategic positions arose once again.

Fortuitously, the world has changed with them. During the Cold War, the world was bipolar, and a peaceful alliance with either the United States or Russia had become the only guarantee of economic and military security. This trend continued after the fall of the Soviet Union, when US military, economic and political power guaranteed free access to sea-lanes and security for the newly created European Union, a bloc that has further enabled Germany to develop as a near-exclusively economic power.

The recent changes in rhetoric and policy by Japan and Germany are in response to yet another transformative geopolitical shift. Both countries are the economic and industrial leaders of their respective regions, but both are growing increasingly aware that the US security guarantees that had been the hallmark of the global order since 1991 may not be as credible as they once were. In the aftermath of global economic crisis and military overreach in the Middle East, the United States is disengaging from its hegemonic military role in the world, pursuing a policy of regional self-balancing instead. In other words, Japan and Germany are increasingly expected to shoulder the burden of their own security and play a greater stabilizing role within their regions.

In addition, Tokyo and Berlin face secular crises domestically and in their immediate periphery. Japan’s shrinking population and decades of economic stagnation threaten its status as the preeminent Pacific power, while Germany has to contend with an ailing European Union, with which its economic and political fate is closely tied.

Finally, Japan and Germany face the resurgence of old foes. Under President Vladimir Putin, Russia has expanded its influence closer to Europe, threatening the continent’s stability in the event of collapse. Japan faces a similar threat to its west. China continues to expand its reach across the region and seeks to challenge the naval power of Tokyo and Washington, albeit unsuccessfully. Like Russia for Germany, a destabilized China — not a far-fetched possibility for a country transitioning out of a full-employment export-based economy — presents significant challenges for Japan’s future.

As these geopolitical fault lines continue to loom over Japan and Germany, both countries will continue to reclaim greater regional and global roles outside their traditional spheres of trade and economics, focusing particularly on aspects of security and regional political stability.

Republishing by The Manila Times of this Geopolitical Diary is with express permission of STRATFOR.