For the first time since 2004, Japanese authorities intervened in the global currency markets Wednesday, buying U.S. dollars and selling yen in a $12 billion foreign exchange designed to drive the dollar higher and protect Japan’s export market.

The Nikkei stock average closed 2.34% higher after Japan intervened in the currency markets, though U.S. stocks struggled to find their footing. In midday trading, the Dow Jones industrial Average was up just 21 points, or 0.2%, to 10,548.

The move sparked a market rally that pushed the dollar up 3% to trade higher than 85 against the yen. The U.S. currency had been trading against the yen at a 15-year low below 83 yen as safe-haven seekers from all parts of the globe put their money into Japan.

Because Japanese exports are a major factor in the country’s economic stability, another intervention is a possibility.

“We conducted a currency intervention to check excessive volatility in currency markets,” Finance Minister Yoshihiko Noda was quoted as saying in The New York Times on Wednesday. “We will continue to watch currency market moves and take decisive steps if necessary, including intervention.”

Japan last intervened in the currency markets in 2004, when the yen was trading at 109 to the dollar.