* Greece news may only have temporary effect -analyst
* Nikkei unlikely to break 9,800 in next few weeks-analysts
* Some signs of investors' appetite in large-cap shares
By Hideyuki Sano
TOKYO, June 24 (Reuters) - The Nikkei average rose to a three-week closing high on Friday, helped by news that Greece has agreed to a five-year austerity plan and as a fall in oil prices eased worries about a slowdown in the U.S. economy.
There was buying in large-cap shares, market players said, adding that it could be a sign of new long positions although some doubt the Nikkei can break above 9,800 in the near future, as gains have been capped around that level since early May.
"There's a feeling that the impact of negative factors which have hurt global shares is petering out. It may take a little while before U.S. data shows improvement but I think the market has put the worst behind it," said Hisashi Kuroda, general manager of equity investments at Meiji Yasuda Asset Management.
European Union leaders promised more money to help Greece stave off looming bankruptcy, and although Athens still faces many hurdles, including a parliamentary vote on the austerity measures next week, the news did ease investor nervousness.
"The market is riding a rebound in global shares after the Greece news. There appears to be fresh buying from investors too. Some shares such as Sony have fallen enough to lure bargain-hunting," said Toshiyuki Kanayama, a market analyst at Monex Securities.
The benchmark Nikkei rose 0.9 percent to 9,678.71, its highest close since June 1. Strong resistance is seen at its 200-day moving average of 9,850.
The broader Topix index also gained 0.9 percent, to 833.20.
The Nikkei's gains were slightly smaller than its peers in Asia, with the MSCI ex-Japan Asia-Pacific index rising 1.1 percent. But since the beginning of June, the Nikkei is down 0.2 percent, compared to a fall of 4.7 percent in the ex-Japan index.
A fall in oil prices to four-month lows after a release of emergency oil reserves by major economies is expected to help the U.S. economy as high gasoline prices have been hurting consumers.
That slide in oil prices boosted shares of shipping firms with Mitsui O.S.K. rising 3.2 percent to 417 yen.
Sony Corp gained 2.4 percent, snapping six weeks of losses for a weekly gain of 4.5 percent. Mitsubishi UFJ Morgan Stanley Securities raised its rating to "outperform" from "neutral", citing its efforts to cut procurement costs.
Electronics conglomerate Toshiba jumped 4.9 percent after a similar upgrade to "outperform" from "neutral" by Mitsubishi UFJ Morgan Stanley analyst Masahiko Ishino.
Mass production of 19-nanometre NAND flash memory, new chip capacity expansion, and nuclear power and thermal power operations will drive its earnings, he said.
Trade volume was 1.76 billion shares, in line with the recent daily average. Advancers outnumbered decliners by 1,144 to 406. (Editing by Edwina Gibbs)