Our net interest margin decreased 6 basis points, to 2.97%, for the three months ended June 30, 2023 from 3.03% for the three months ended June 30, 2022.
Interest Income. Interest income increased $168.8 million, or 189%, to $258.1 million for the three months ended June 30, 2023, compared with $89.3 million for the three months ended June 30, 2022. This increase was primarily attributable to an increase in both higher average yields and balances of loans and loans held for sale, as well as higher balances in securities held to maturity.
The average balance of loans, including loans held for sale, during the three months ended June 30, 2023 increased $3.3 billion, or 38%, to $12.0 billion compared to the three months ended June 30, 2022. The average yield on loans increased 368 basis points, to 7.67% for the three months ended June 30, 2023, compared to 3.99% for the three months ended June 30, 2022. The increase in average balances of loans and loans held for sale was primarily due to increases in the multi-family and healthcare portfolios, but all loan portfolios contributed to the growth during the period.
The average balance of securities held to maturity, during the three months ended June 30, 2023 increased $1.1 billion, or 100%, to $1.1 billion compared to the three months ended June 30, 2022, as none were owned as of June 30, 2022. The average yield on securities held to maturity was 6.35% for the three months ended June 30, 2023.
The average balance of securities available for sale increased $342.1 million, or 103%, to $672.9 million for the three months ended June 30, 2023 from $330.8 million for the three months ended June 30, 2022, while the average yield increased 221 basis points, to 3.32% for the three months ended June 30, 2023, compared to 1.11% for the three months ended June 30, 2022.
The average balance of interest-earning deposits and other decreased $117.8 million, or 32%, to $249.7 million for the three months ended June 30, 2023 from $367.5 million for the three months ended June 30, 2022, while the average yield increased 437 basis points, to 5.36% for the three months ended June 30, 2023, compared to 0.99% for the three months ended June 30, 2022.
The average balance of mortgage loans in process of securitization increased $81.7 million, or 41%, to $280.1 million for the three months ended June 30, 2023 compared to the three months ended June 30, 2022, while the average yield increased 155 basis points, to 4.48% for the three months ended June 30, 2023, compared to 2.93% for the three months ended June 30, 2022.
Interest Expense. Total interest expense increased $135.2 million, or 784%, to $152.5 million for the three months ended June 30, 2023, compared to the three months ended June 30, 2022.
Interest expense on deposits increased $123.0 million, or 833%, to $137.8 million for the three months ended June 30, 2023 from $14.8 million for the three months ended June 30, 2022. The increase was primarily due to higher rates on certificates of deposit, interest-bearing checking, and money market accounts.
The average balance of certificates of deposit of $4.7 billion for the three months ended June 30, 2023 increased $4.1 billion, or 639%, compared to the three months ended June 30, 2022. The average yield of certificates of deposit was 4.98% for the three months ended June 30, 2023, which was a 423 basis point increase compared to 0.75% for three months ended June 30, 2022.
The average balance of interest-bearing checking accounts of $4.3 billion for the three months ended June 30, 2023 increased $457.9 million, or 12%, compared to $3.8 billion for the three months ended June 30, 2022. The average yield of interest-bearing checking accounts was 4.50% for the three months ended June 30, 2023, which was a 378 basis point increase compared to 0.72% for three months ended June 30, 2022.
The average balance of money market accounts of $2.7 billion for the three months ended June 30, 2023 increased $122.6, or 5%, compared to $2.6 billion for the three months ended June 30, 2022. The average yield of money market