primarily due to a $3.2 million decrease in gain on sale of loans, partially offset by a $1.0 million increase in net interest income, a $770,000 decrease in noninterest expense, and a $238,000 decrease in the provision for income taxes.
Interest and Dividend Income. Interest income increased $478,000, or 12.5%, to $4.3 million for the six months ended June 30, 2022 compared to June 30, 2021. Interest income on loans increased $485,000, or 13.5%, to $4.2 million as of June 30, 2022. The average balance of portfolio loans during the six months ended June 30, 2022 increased $35.7 million to $213.1 million, compared to the six months ended June 30, 2021. The increase in average portfolio loans outstanding was primarily concentrated in one to four family owner-occupied mortgage loans, nonresidential mortgage loans, multifamily loans, and land and construction loans. The average yield on loans decreased 23 basis points to 3.83% for the six months ended June 30, 2021 from 4.06% for the six months ended June 30, 2021. The average balance of loans held for sale decreased $6.8 million during the six months ended June 30, 2022 compared to the same six month period in 2021, while the average yield on loans held for sale increased 146 basis points, to 4.06% for the six months ended June 30, 2022 from 2.60% for the same six months in 2021.
Interest income on securities increased $4,000, or 12.6%, for the six months ended June 30, 2022. The average balance of securities decreased $1.5 million to $7.5 million at June 30, 2022. The yield on securities increased 26 basis points due to higher market interest rates. Interest income on other interest-earning assets increased $35,000, or 97.2%. The yield on other interest-bearing assets increased 57 basis points due to a higher dividend rate paid on FHLB stock and the increase in short term interest rates. The investment securities portfolio is composed of monthly adjustable rate securities tied to the one month T-Bill, one month LIBOR or the one year Treasury index.
Interest Expense. Total interest expense decreased $546,000, or 54.5%, to $457,000 for the six months ended June 30, 2022 from $1.0 million for the six months ended June 30, 2021. Interest expense on deposit accounts decreased $102,000, or 18.7%, to $445,000 for the six months ended June 30, 2022 compared to the six months ended June 30, 2021. The decrease in deposit expense between comparable periods in 2022 from 2021 was primarily due to a 32 basis point decrease in the average cost of deposits primarily due to lower market interest rates.
Interest expense on savings increased $52,000, or 108.3%, during the six months ended June 30, 2022 compared to the six months ended June 30, 2021, due to an increase in the average balance of savings accounts of $25.0 million. The average cost of savings accounts increased 8 basis points compared to the same period ended June 30, 2021. Interest expense on interest-bearing demand accounts increased $3,000. The average cost of interest-bearing demand deposits remained at 14 basis points. The average balances in interest-bearing demand accounts increased $4.1 million during the six months ended June 30, 2022 compared to the same period ended June 30, 2021. Interest expense on certificates of deposit decreased $157,000, or 32.9%. The average cost of certificates decreased 86 basis points to 0.74%. The average balance of certificates of deposit increased $26.3 million to $86.0 million for the six months ended June 30, 2022 compared to the same period ended June 30, 2021.
Interest expense on FHLB advances decreased $444,000, or 97.4%, to $12,000 for the six months ended June 30, 2022 from the six months ended June 30, 2021. The average balance of advances decreased $34.9 million, or 90.5%, for the six months ended June 30, 2022. The average cost of FHLB borrowings decreased 171 basis points to 0.65% for the six months ended June 30, 2022.
Net Interest Income. Net interest income increased $1.0 million, or 36.3%, for the six months ended June 30, 2022 compared to the same period in 2021. The interest rate spread increased to 3.09% for the six months ended June 30, 2022 compared to 2.35% for the six months ended June 30, 2021. The net interest margin increased 62 basis points to 3.17% at June 30, 2021 compared to 2.55% at June 30, 2021.
Provision for Loan Losses. Based on our analysis of the factors described in “Critical Accounting Policies – Allowance for Loan Losses” we recorded a provision for loan losses of $134,000 for the six months ended June 30, 2022. The allowance for loan losses was $1.8 million, or 0.70% of total loans, at June 30, 2022, compared to $1.7 million, or 0.82% of total loans, at June 30, 2021. The Company had no net charge-offs during the six month period ended June 30, 2021. Given the growth in the loan portfolio during the six months ended June 30,2022, an increase in the allowance was warranted. Total past due loans were $209,000, or 0.08% of loans at June 30, 2022. The Company had no net charge-offs during the three-month period ended June 30, 2022. As a percentage of nonperforming loans, the allowance for loan losses was 3,320.4% at June 30, 2022.
The credit quality of the Bank’s loan portfolio remained consistent with recent periods, as measured by low levels of nonperforming and delinquent loans, classified loans and impaired loans. As of June 30, 2022, we had no loans deferring loan