Prices recover after selloff, yield curve flattens

US 10-YR
US 30-YR

U.S. Treasury prices recovered from an early week selloff on Friday in very light trading, and the yield curve was the flattest in six-and-a-half years on the prospect of an interest rate hike in the coming months.

Bonds weakened early in the week as investors were reluctant to take on long positions before year-end and as improving economic data raised bets that the Federal Reserve is getting closer to raising interest rates. At the same time the Treasury sold $104 billion in new intermediate-dated supply.

"Anytime bonds came out for sale everyone was backing up their bids and letting prices fall to where the auctions would attract sizable overseas interest," said Jim Vogel, an interest rate strategist at FTN Financial in Memphis, Tennessee.

Read MoreGoldman: Here's how to play rising interest rates

Friday's bounce was in very light volumes with no data or other events driving price moves the day after Thursday's Christmas holiday. Intermediate-dated debt has underperformed long bonds in recent months as investors prepare for a possible interest rate increase that many expect may happen by June.

U.S. bonds still attract interest, however, as they pay much higher yields than comparable German and other sovereign bonds. U.S. five-year notes pay 173 basis points more than comparable German debt, the widest spread since 1999.

The yield curve between five-year notes and 30-year bonds flattened to 105 basis points on Friday. The next major focus for the market will be the release on Jan 7 of minutes from the Fed's December meeting, when the central bank changed its vow to keep interest rates near zero for a "considerable time," to say that it would remain "patient."

"If there were a sizable group in the board that didn't like the word 'patient,' because again it's got a time dimension, that will cause some turmoil," said Vogel.

Read MoreMarket may return gains after Santa Rally: Pro

Long-dated U.S. Treasury prices ended higher on Wednesday and the yield curve resumed flattening as investors bet that the Federal Reserve is closer to raising interest rates. The Treasury yield curve is its flattest in six years and two-year note yields are the highest in three-and-a-half years as traders prepare for an imminent rate hike.

Money markets are also adjusting. Overnight index swaps indicate the federal funds rate will more than double to 30 basis points in a year. "People are gaining confidence that the economy is on very solid ground, and the Fed is probably going to move earlier than June, and that all rates should rise," said Charles Comiskey, head of Treasuries trading at Bank of Nova Scotia in New York.

The government sold $29 billion in new seven-year notes on Wednesday to tepid demand. The notes sold at a high yield of 2.125 percent, the highest since September. The bid to cover ratio was the lowest since November 2013 as direct bidders bought the lowest share of the bonds since February 2011.

CNBC contributed to this report.