Freddie Mac, the second-biggest provider of U.S. residential mortgage funding, said on Thursday its loss widened to a record $2.5 billion in the fourth quarter as the housing crisis worsened.

A sharper-than-expected drop in home prices that first sparked a crisis in subprime lending last summer has since tainted all types of mortgages, hurting Freddie Mac's and rival Fannie Mae's ability to support the housing market. Fannie Mae said on Wednesday it posted a $3.6 billion loss.

But in a sign financial markets thought the worst news may be behind both companies, their share prices, which have been battered in recent months, rose more than four percent on Thursday.

As the housing crisis worsened, rising delinquencies and foreclosures have forced the companies to write down the values of mortgage securities they own and boost reserves to cover their guarantees of payment on bonds held by investors.

Losses led the companies to sell $13.8 billion in preferred stock last quarter to boost capital needed for growth.

Freddie Mac's ability to maneuver in 2008 is severely limited after fourth quarter results ate through almost one-half the preferred capital raised during the period, Jim Vogel, a strategist at FTN Financial in Memphis, Tennessee, said in a note to clients.

Freddie Mac shares, which are down 23 percent this year, were up 4.4 percent at $26.20 by midmorning, while Fannie Mae's shares were up about 4.5 percent at $28.47. Freddie Mac's shares initially had dropped after the results.

Freddie Mac lost $3.97 per share in the fourth quarter -- far more than Wall Street analysts' expectations of a loss of $2.48 per share, according to Reuters Estimates.

The government-chartered company said its net loss increased from $401 million in the year-earlier period. It is coming off a $1.2 billion loss for the third quarter that was revised from $2 billion after an accounting change.

Citing the severe housing downturn, Freddie Mac increased its estimate of total credit losses by a combined $1.5 billion for 2008 and 2009. It now expects losses of $2.2 billion and $2.9 billion for the next two years, respectively.

We will be cautious going into the year because we think 2008 will be a very telling year as to where the credit market is going, Buddy Piszel, Freddie Mac's chief financial officer, told Reuters.

Credit-related expenses were $912 million for the quarter, while total credit losses were $236 million.

McLean, Virginia-based Freddie Mac, which was chartered by Congress in 1970 to boost U.S. homeownership, is struggling to strike a balance between growing its business while tightening underwriting guidelines to protect itself from further losses.

The federal regulator for Freddie Mac and Fannie Mae on Wednesday lifted restrictions on the growth in the companies' combined $1.4 trillion mortgage portfolios, giving them more flexibility to support the ailing housing market.

But dire predictions for foreclosures will probably keep the companies conservative with their capital, analysts said.

Freddie Mac, as of January 1, had $4.5 billion in capital above the amount mandated by its federal regulator. The regulator on Wednesday said it was considering easing capital requirements, a signal of more optimism than certainly we've heard earlier, Piszel told Reuters.

The company will take advantage of buying opportunities but not grow aggressively, he said.

It's really about having the capital flexibility to manage throughout the year, Piszel said, adding that he was happy with the current capital base.