By Min Zeng

U.S. government bonds strengthened broadly Wednesday after a $34 billion sale of five-year notes drew the strongest demand in more than two years.

A gauge of foreign demand for the auction hit a record high as U.S. bonds continued to offer more attractive yields compared with their peers in Europe and Japan.

Treasury bond prices had strengthened earlier as lower U.S. stocks and a disappointing housing report stoked demand for haven debt. The strong auction added to the bond market's strength.

In recent trading, the yield on the benchmark 10-year Treasury note was 2.521%, according to Tradeweb, compared with 2.563% Tuesday. Yields fall as bond prices rise.

"The bond market drew buyers on a day where U.S. stocks are struggling, " said Jim Vogel, interest rates strategist, at FTN Financial.

The Dow Jones Industrial Average stock index was recently down 0.4%, stalling its march toward 20,000, a level it has never crossed.

The five-year auction result contrasted with a sale of two-year notes on Tuesday that drew the smallest demand since 2008. Analysts say the auction benefited from some investors moving away from stocks as the year's end approaches.

A gauge of foreign demand for the five-year sale, the indirect bidding, soared to 71.4%. That surpassed the previous record of 68.7% in August 2016.

The five-year notes were sold at a yield of 2.057%. The five-year German government bond yielded negative 0.54%.

One support for the Treasury bond market near term is the prospect of pension funds rebalancing their portfolios following strong gains in stocks and the selloff in bonds since the U.S. election, said some analysts. Pension funds typically have a targeted allocation among different asset classes, so they need to readjust, or rebalance, the allocation ratio on either a quarterly or monthly basis.

Boris Rjavinski, senior fixed-income strategist at Wells Fargo Securities, said the bank's model estimates that U.S. defined-benefit pension funds will need to add about $20 billion in bonds versus roughly $32 billion in outflows from domestic equities.

The National Association of Realtors said Wednesday that its pending-home-sales index, which tracks contracts signed for purchases of existing homes, fell 2.5% from October. Economists surveyed by The Wall Street Journal had expected a 0.5% rise in November.

Some other housing data pointed to resilience of the housing market, yet economists said Wednesday's release flagged the risk that higher mortgage rates started to affect demand.

U.S. mortgage rates reached the highest in more than two years earlier this month, driven by the broad rise in Treasury bond yields which are used to set long-term borrowing costs for U.S. consumers and businesses. The 10-year Treasury yield has been up more than 1 percentage point from its record low set in early July.

Trading is thinner than normal due to the holiday season, which tends to exaggerate part of the price moves, according to analysts.

Government bond yields in the developed world have been rising after falling to their historic lows in the summer. The yield was headed for a second consecutive year of gains, up from 2.273% at the end of 2015.

The shift toward higher yields reflects rising expectations among investors of a brighter growth outlook, higher inflation and potentially a faster pace of interest-rate increases by the Federal Reserve. Selling in the bond markethad intensified after the U.S. election in early November. The prospect of expansive fiscal policy from President-elect Donald Trump in the coming year has added to expectations of stronger economic growth and higher inflation.

The Treasury bond market over all has handed investors a total return of 0.35% this year through Tuesday, according to Bloomberg Barclays bond indexes data. The sector had logged a 6.2% return between the end of last year and July 8, when the 10-year yield closed at a record-low yield of 1.366%.

Long-term bonds suffered even more. Treasury debt maturing in 10 years or more posted a negative 0.27% return this year through Tuesday, after posting a 19% return through July 8. Total return includes bond price changes and interest payments.

The selling pressure eased last week, with the 10-year yield posting the first weekly decline in seven weeks. Some analysts say the selloff is overdone and that the 10-year yield around 2.6% attracts some buying interest.

Write to Min Zeng at min.zeng@wsj.com

(END) Dow Jones Newswires

December 28, 2016 14:08 ET (19:08 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.