A GENERATION ago, Japan was a colossus on any investing map of the world.

Envious foreigners called its export-driven economy a “miracle.” Its real estate and stock markets seemed to defy gravity, and its financiers were so flush with cash that they bought skyscrapers, golf courses and corporate empires far from Japan’s shores.

Then the bubble burst. In 1990, Japan began more than 20 years of stagnation and deflation. Invest in Japan? For most foreigners, it was wiser to avoid it. At the end of 1989, the Topix, a k a the Tokyo Stock Price index, reached 2,881. Now it’s less than half that.

It’s possible, at least, that those lost decades are finally over. Japanese markets have become turbocharged again, and are beginning to move markets worldwide. This year alone, the Topix has risen more than 22 percent in dollar terms, far exceeding the gain of the Dow Jones industrial average and nearly every other major stock market. The yen has weakened sharply, trading at more than 100 to the dollar for the first time in four years. That exchange rate should make many Japanese companies more profitable and more competitive. It may also inject inflation into the Japanese economy, encouraging consumers to spend and companies to invest.

“What is happening in Japan is revolutionary,” said Mohamed El-Erian, the chief executive of Pimco, one of the world’s largest bond managers. “Nothing they’ve done since the Second World War comes close in terms of economic experimentation,” he said.