Interest income was $33.9 million for the three months ended June 30, 2024, an increase of $2.3 million, or 7%, from $31.6 million for the three months ended June 30, 2023. The increase in interest income was primarily due to the yield earned on the average balance of our interest-earning assets as these portfolios repriced higher in the higher interest rate environment. The yield on the average balance of our loans, securities, and other interest-earning assets increased 77 basis points, 126 basis points and 32 basis points, respectively, for the three months ended June 30, 2024 as compared to the three months ended June 30, 2023. The increase in the yield on the average balance of our loans was primarily due to residential mortgage rates resetting in the higher interest rate environment. The increase in the yield on the average balance of our securities was primarily due to the yield on our recently purchased securities being higher than the yield on the average balance of our securities for the three months ended June 30, 2023. The yield on the average balance of our other interest-earning assets, which are comprised primarily of cash and due from banks, benefitted from the higher rate environment as correspondent banks and the Federal Reserve increased their deposit rates and overnight funding rates. Also contributing to the increase in interest income, the average balance of our securities portfolio of $464.4 million for the three months ended June 30, 2024 increased $89.3 million, or 24%, compared to the three months ended June 30, 2023, and the average balance of our other interest-earning assets of $618.8 million for the three months ended June 30, 2024 increased $77.0 million, or 14%, compared to the three months ended June 30, 2023. Partially offsetting the increase in interest income was the decline in interest income earned on our loans since the average balance of our loans decreased $262.0 million, or 17%.
Interest expense was $19.5 million for the three months ended June 30, 2024, an increase of $4.1 million, or 27%, from $15.4 million for the three months ended June 30, 2023. Similar to our interest-earning assets, the increase in our interest expense was primarily driven by the change in interest rates. The rate paid on the average balance of interest-bearing deposits increased 119 basis points. We continued to competitively price our deposits as rates continued to rise in 2023 and as competition for deposits significantly increased. Interest expense for the three months ended June 30, 2024 also reflected the elimination of interest expense from our Subordinated Notes, which were redeemed in the third quarter of 2023, and totaled $1.8 million for the three months ended June 30, 2023.
Net interest margin was 2.44% for the three months ended June 30, 2024, down 20 basis points from 2.64% for the three months ended June 30, 2023. The interest rate spread was 1.84% for the three months ended June 30, 2024, down 32 basis points from 2.16% for the three months ended June 30, 2023. Our net interest margin and interest rate spread were negatively impacted during the three months ended June 30, 2024, by higher interest rates paid on our interest-bearing deposits than in the comparable period in 2023, which outpaced the increase in the average yield on our interest-earning assets over the same period.
Six Months Ended June 30, 2024 Compared to the Six Months Ended June 30, 2023
Net interest income was $29.3 million for the six months ended June 30, 2024, a decrease of $4.5 million, or 13%, from the six months ended June 30, 2023. The decrease in net interest income primarily reflects interest expense on total interest-bearing deposits increasing more than interest income during the high-rate environment.
Interest income was $67.1 million for the six months ended June 30, 2024, an increase of $6.2 million, or 10%, compared to the six months ended June 30, 2023. The increase in interest income was primarily due to a 67 basis point increase in the yield earned on the average balance of our total interest-earning assets with the rates on residential real estate loans, securities and other interest-earning assets increasing 105 basis points, 113 basis points and 55 basis points, respectively, as these portfolios repriced upward significantly in the higher interest rate environment. Also contributing to the increase in interest income, the average balance of our securities portfolio of $451.1 million for the six months ended June 30, 2024 increased $80.3 million, or 22%, compared to the six months ended June 30, 2023, and the average balance of our other interest-earning assets of $610.3 million for the six months ended June 30, 2024 increased $133.1 million, or 28%, compared to the six months ended June 30, 2023. Partially offsetting the increase in interest income was the decline in interest income earned on our loans since the average balance of our loans decreased $281.0 million, or 18%.
Interest expense was $37.8 million for the six months ended June 30, 2024 compared to $27.1 million for the six months ended June 30, 2023. Similar to our interest-bearing assets, the increase in our interest expense was primarily driven by the change in interest rates. The increase in interest expense was primarily due to an increase in the rate paid on our interest-bearing deposits of 140 basis points from the six months ended June 30, 2023. Specifically, the average rate paid on money market, savings and NOW accounts, and time deposits increased 144 basis points and 137 basis points, respectively, compared to the six months ended June 30, 2023, as we continued to competitively price our deposits. Interest expense for the six ended June 30, 2024 also reflected the elimination of interest expense from our Subordinated Notes, which were redeemed in the third quarter of 2023 and totaled $3.5 million for the six months ended June 30, 2023.