NEW YORK, Oct 16 (Reuters) - Long-term U.S. Treasury yields may still have room to rise but they could swing in both directions in the near term as inflation eases and the Federal Reserve nears a peak in interest rates, the BlackRock Investment Institute said on Monday.

The institute, an arm of the world's largest asset manager BlackRock, said it had turned "neutral" on long-term Treasuries on a six-to-12-month horizon from a previous underweight recommendation.

Treasury yields, which move inversely to prices, have risen sharply since the U.S. central bank started raising interest rates in March 2022 to fight a surge in inflation. Long-term bond yields have recently hit highs not seen in more than a decade and a half as a surprisingly resilient economy raised the prospect that interest rates will remain higher for longer.

"The repricing of Federal Reserve policy rates has been a big part of the yield move ... since the Fed's first hike in 2022. We see the yield surge driven by expected policy rates nearing a peak," the BlackRock Investment Institute said in a note.

On a long-term basis, however, it remained underweight as it expects investors will ask for more compensation to hold long-term paper due to factors such as persistent inflation, rising fiscal deficits and increasing government bond issuance.

"Rising term premium will likely be the next driver of higher yields. We think 10-year yields could reach 5% or higher on a longer-term horizon," it said.

Benchmark 10-year Treasury yields were at around 4.7% on Monday, down from a peak of 4.887% hit earlier this month - the highest they have been since 2007.

The investment institute has been underweight long-term U.S. government bonds since late 2020 as it expected yields to rise. "U.S. 10-year yields at 16-year highs show they have adjusted a lot – but we don't think the process is over," it said.

While Treasury yields have risen since the Fed started hiking rates, investment grade credit spreads - or the premium investors demand to hold corporate debt rather than safer government bonds - have tightened.

The institute said it had become more bearish on investment grade credit over the next six to 12 months "due to limited compensation above short-dated government bonds." (Reporting by Davide Barbuscia; Editing by Paul Simao)