Countrywide Financial ( CFC) shares shrugged off a mortgage-sector downgrade to rise in midday trading Monday.

The gain comes at the end of a recent plunge in shares of the Calabasas, Calif., mortgage lender. Countrywide shares dropped 19% last week as investors resumed worrying about the health of the credit markets amid a sharp downturn in the U.S. housing market. The stock traded as low as $15.01 Friday -- just a penny above the lows Countrywide touched two months ago, during a liquidity crisis that ended with a Fed rate cut and Countrywide tapping an $11.5 billion emergency credit line.

Renewed fears about the housing market led Lehman Brothers to slash its sector outlook Monday. Analyst Bruce Harting cut his rating on the mortgage finance sector to negative from neutral, downgrading the stocks of lenders IndyMac ( IMB) and Washington Mutual ( WM) and mortgage insurer PMI Group ( PMI).

"Even though the marketplace learned that the mortgage market could potentially experience $100 billion or more in cumulative losses in coming years, only a fraction of these losses have been realized, and each quarter the numbers will likely get larger and could put more downward pressure on stocks," he writes in an industry note. "There is no way of telling how large the embedded losses are in any mortgage lender's portfolio, especially when it comes to home equity loans and layered risk loans."

The news comes as investors brace for Countrywide's third-quarter earnings report on Friday. Analysts expect the nation's largest lender to lose $1.05 a share.

Countrywide's stock isn't the only thing that has come under pressure recently. CEO Angelo Mozilo is under increasing scrutiny due to his massive stock sales. CtW Investment Group recently mailed Countrywide's board a letter demanding Mozilo's resignation. The letter comes just days after it was reported that the Securities and Exchange Commission is probing Mozilo's handling of his 10b5-1 insider stock-sale program.

Meanwhile, the housing crunch has hit banks well beyond the specialized mortgage finance industry. Last week, big banks such as Citigroup ( C), Wachovia ( WB) and WaMu posted weaker-than-expected third-quarter numbers that were pulled down by rising loan losses and credit reserves.

Harting also lowered his rating on the specialty finance sector, which includes credit card companies, to neutral from positive. Harting cut his ratings on American Express ( AXP), Capital One ( COF) and Discover Financial ( DFS) to equal weight from overweight.

"We believe that the hefty losses in the mortgage sector cannot happen in a vacuum, and that it is just a matter of time before problems spill over to the other loan sectors in consumer finance, most notably credit cards, auto and other forms of credit," he writes in the industry note.

Countrywide rose 28 cents to $15.51.

More from Stocks

Market Can't Handle the Wild Ride: Cramer's 'Mad Money' Recap (Thursday 5/24/18)

Market Can't Handle the Wild Ride: Cramer's 'Mad Money' Recap (Thursday 5/24/18)

Replay: Jim Cramer on North Korea, Oil Prices, Apple and Carnival Corporation

Replay: Jim Cramer on North Korea, Oil Prices, Apple and Carnival Corporation

Canopy Growth: First Cannabis Firm on the NYSE Fails to Generate Buzz

Canopy Growth: First Cannabis Firm on the NYSE Fails to Generate Buzz

Video: This Startup Connects Buyers and Sellers of Legal Marijuana

Video: This Startup Connects Buyers and Sellers of Legal Marijuana

Dow, S&P 500 and Nasdaq Tumble After Trump Calls Off North Korea Summit

Dow, S&P 500 and Nasdaq Tumble After Trump Calls Off North Korea Summit