May 15 (Reuters) - Shares of New York Community Bancorp rose nearly 5% in premarket trading on Wednesday, after the lender agreed to sell a portfolio of about $5 billion in mortgage warehouse loans to JPMorgan Chase.

The deal with the largest U.S. bank by assets, announced late on Tuesday, will bolster liquidity at NYCB, which is planning to invest the proceeds from the sale in cash and securities.

Earlier in May, the embattled bank laid out a turnaround plan to return to profitability over the next two years and vowed to shrink its balance sheet by reducing non-core assets.

"The loan sale is exactly what the new management team discussed on the first-quarter earnings call, which is an important first step (of many) for management to restore credibility as the team looks to improve profitability," analysts at Jefferies wrote in a note.

Warehouse loans, given to lenders that use the capital to provide mortgages, accounted for 6%, or $5.2 billion, of the total loans worth $82.3 billion at NYCB, as of March 31.

NYCB has pledged to cut exposure to the commercial real estate (CRE) sector, its core business, which has been roiled by higher borrowing costs and lower occupancy, to around $30 billion from nearly $47 billion at the end of March.

Analysts and investors expect it will have to lure buyers for its loans with steep discounts, and diversify its revenue as it races to shore up its finances.

Brokerage Raymond James reiterated its "underperform" rating on the stock after the loan sale.

"Aggressive underwriting for multi-family and CRE loans will take an extended period to resolve, and that the risks increase should rates continue to rise," the brokerage wrote in a note.

A stock rout since January wiped billions off NYCB's market value, roughly a year after the collapse of Silicon Valley Bank and Signature Bank ignited widespread concerns over the health of the sector.

NYCB's stock was last trading at $4.07 before the bell on Wednesday. It is down roughly 62% so far this year.

The lender received a $1 billion lifeline in March from an investor consortium led by former U.S. Treasury Secretary Steven Mnuchin's Liberty Strategic Capital.

NYCB said it expects the sale to close in the third quarter. It did not disclose the deal value of the sale.

(Reporting by Manya Saini and Niket Nishant in Bengaluru; Editing by Krishna Chandra Eluri)