* Dollar rises vs yen, pares losses vs euro
* Fed to extend bond buying, says economy is leveling out
* Stocks rise, Treasury prices drop after Fed
(Adds comments, details. Updates prices)
By Vivianne Rodrigues
NEW YORK, Aug 12 (Reuters) - The dollar gained versus the yen and pared losses against the euro on Wednesday after the Federal Reserve said economic activity is "leveling out," suggesting the economy is through the worst of the recession.
The Fed also said it would extend by one month through October the duration of a program to buy long-term government securities but would not increase the amount of purchases.
Analysts viewed this as a sign the central bank thought the economy was improving but said its move to extend the time-frame of asset purchases signaled the economy remains vulnerable.
"The dollar was boosted ... as people are focusing on the somewhat more hopeful outlook," said David Watt, a senior currency strategist at RBC Capital Markets in Toronto.
"But the Fed won't be moving the punch bowl away soon," he added. "That reflects some caution, but it's hopeful that they didn't expand the program. They sort of split the difference -- they won't expand the program but recognize that the economy still has vulnerabilities."
Adding to that view, the Fed also held interest rates near zero as expected and said they would likely stay there for an extended period.
The dollar was 0.2 percent higher at 96.08 yen after swinging between 96.75 and 95.13 yen in the session. The euro was still up 0.3 percent on the day at $1.4198, but below $1.4231 where it traded before the Fed's announcement.
Bank of New York-Mellon currency strategist Michael Woolfolk said dollar gains were capped by the Fed's extension of the asset-purchase deadline.
"The Fed is not yet convinced that the economy is on solid ground," he said, adding that Fed Chairman Ben Bernanke "knows very well the risks associated with removing stimulus too quickly."
The Fed slashed interest rates to a range of between zero and 0.25 percent in December and has pumped money rapidly into the economy to stimulate economic activity in the worst recession in decades. Part of that includes $300 billion set aside to buy long-dated U.S. government bonds.
LEVELING OUT
Stocks extended gains and U.S. Treasury prices tumbled as the Fed statement gave a slightly more upbeat but guarded assessment of the U.S. economy, saying for the first time that activity is "leveling out" but was likely to remain weak "for a time."
"The outcome of this decision is still much more dollar bullish," said Kathy Lien, a director of currency research at GFT Forex in New York.
Some analysts said that continues a trading theme that began late last week when the dollar rose on better-than-expected U.S. employment data. For most of the year, the dollar has weakened on good economic news and rallied when anxious investors needed bought it as a safe haven.
The focus on the Fed overshadowed a U.S. Commerce Department report that indicated the U.S. trade deficit widened in June to $27 billion.
Also on Wednesday, Norway's central bank held its main interest rate unchanged at a record low of 1.25 percent, in line with analyst forecasts as the Norwegian economy has shown signs of stabilization.
The dollar was 2 percent lower against the Norwegian crown, while the euro fell 1.9 percent against the Norwegian currency. (Additional reporting by Wanfeng Zhou and Steven C. Johnson; Editing by Kenneth Barry)