The double-whammy of rising Treasury yields and the end of the Federal Reserve's $1.25 trillion mortgage-buying program could prove to be a buying opportunity for the biggest bond investors.

Even while the recent surge in yields has unsettled parts of the stock and bond markets, fixed-income money managers like Pacific Investment Management Co, or PIMCO, Vanguard Group and TCW are mainly unfazed as the selloff could soon result in some enticing bargains.

If mortgage-backed securities were 20 basis points wider tomorrow, I assure you they wouldn't be there for long because everybody would try to buy them, said Scott Simon, head of mortgage- and asset-backed securities at Newport Beach, California-based PIMCO, which oversees more than $1 trillion.

Wednesday, the Fed will end its purchases of mortgage-backed securities (MBS) sold by government-backed mortgage corporations Fannie Mae and Freddie Mac as well as government entity Ginnie Mae.

For more than a year, this so-called agency MBS market has been supported by the big purchasing of the U.S. central bank. By the end of March, the Fed will be the owner of slightly less than a quarter of the mortgage debt market.

But the end of the purchases -- part of the central bank's quantitative easing program -- is unlikely to result in an unraveling of the mortgage market.

That's comforting news for investors and economists as the mortgage buys have played a vital role in stemming the effects of crisis on the U.S. economy while producing lower mortgage rates.

Just a few months ago many strategists and fund managers predicted an MBS yield spread spike of 30 to 60 basis points over Treasuries after the Fed exited. But the view now is for a much more controlled market erosion as the Fed pulls away.

With few competing AAA assets, and pent-up demand strong from buyers who had been pushed into other markets as yields plunged during the Fed-induced mortgage market rally, many fund managers are eager to get back in the MBS game.

They are now convinced the mortgage debt market won't come unhinged as money managers are flush with cash and relative yields are low across various asset classes, including junk bonds at around 6 percent.

I feel comfortable saying that even a 10 basis point widening would pique our interest and we would consider adding some, said Bryan Whalen, a managing director at TCW, which manages more than $115 billion.

Even with last week's surge in Treasury yields, the yield premium on Fannie MBS paying 4.50 percent interest compared with the 10-year Treasury note stands at about 60 basis points -- but not before hitting a low of 56 basis points several weeks ago. That's a huge collapse from a yield premium reached a record wide on an absolute basis of about 220 basis points before the Fed announced its purchase program in late 2008.

IN DEMAND: AAA BONDS

The mortgage market has reacted calmly to the end of the Fed's purchase program because it has been receiving extra support from Fannie Mae and Freddie Mac.

The companies have said they will buy back around $200 billion of delinquent loans from mortgage pools. That has meant more money in the hands of investors to buy more bonds.

There will be enough buyers to replace the Federal Reserve, said James Barnes, fixed income portfolio manager at National Penn Investors Trust Co. in Reading, Pennsylvania, which has had an overweight position in agency MBS.

Added Ken Volpert, head of Vanguard Group's taxable-bond group and co-manager of Vanguard Total Bond Market VBMFX.O: Investors get their cash and they have got to do something with it. They will probably go out and buy more mortgages, so in a sense it does continue to cause this increase in demand for mortgage securities.

If that weren't enough, there has been a shortage of top-rated debt - Fannie and Freddie are rated AAA and now have the unlimited backing of the U.S. government. Persistently low official interest rates have banks and money managers seemingly eager to stock up on agency MBS.

According to the Fed, Bank of America -- the biggest holder among the top five banks -- held roughly $235 billion in mortgage-backed securities as of December, up from $180 billion in September.

Mortgages are still attractive given the carry advantages versus other high-quality fixed income alternatives, said Whalen of TCW. That's why you are seeing interest from investors like us and banks.

(Reporting by Jennifer Ablan and Lynn Adler; Editing by Kenneth Barry)