CALABASAS, Calif. — Countrywide Financial Corp., the nation's largest mortgage lender, said Friday it swung to a loss of more than $1 billion in the third quarter on to rising loan-loss provisions, writedowns and dwindling origination volume.

But the company insisted it will be profitable in this quarter and in 2008, as it restructures its business to take advantage of the current market.

Countrywide posted a third-quarter loss of $1.2 billion, or $2.85 per share, compared with earnings of $647.6 million, or $1.03 per share, during the same quarter a year ago.

Analysts polled by Thomson Financial, on average, forecast a loss of $1.28 per share on revenue of $231.9 million for the quarter.

Countrywide's total revenue fell to a loss of $50 million in the third quarter, on the impact of impairments and charges, from $2.82 billion during the same period a year ago.

Origination volume fell to $96 billion, from $118 billion as Countrywide shifted its product mix to more traditional loans.

Countrywide ramped up its loan-loss reserves to fight rising delinquencies and defaults, especially among subprime mortgages given to customers with poor credit history. Countrywide reserved $934 million for bad loans in the third quarter, up from $38 million held during the same quarter last year.

Countrywide was also forced to take writedowns of $690 million in the third quarter as investors shied away from purchasing subprime mortgages and other nontraditional loans because of their rising delinquencies and defaults.