Irvine-based First PacTrust Bancorp Inc. has agreed to sell eight branches and their deposits to AmericanWest Bank in Spokane, Wash.

The branches are in Riverside, Los Angeles and San Diego counties. First PacTrust will retain 12 branches after the sale, mostly in Orange County and Los Angeles.

Deposits at the eight branches totaled $477 million at the end of March. First PacTrust is expected to gain about $13.5 million in the transaction, which is set to close in October. That includes a 2.3% premium on deposits at the branches being sold, with another $2.5 million for the real estate involved.

The deal will give AmericanWest a total of 20 branches in Southern California.

First PacTrust, which operates as Pacific Trust Bank, is among the largest Orange County-based banks, with $1.6 billion in assets.