in non-interest expense, offset partially by a $2.2 million increase in provision for loan losses. The increase in net gain on mortgage loans was due to an increase in origination volume. The increase in net interest income was due to a reduction in our average cost of funds and an increase in average loan balances. The decrease in non-interest expense was due to a $1.0 million reduction in salaries and employee benefits related to deferred compensation on PPP loan originations and the impact of a $1.6 million goodwill impairment charge related to Capital Management in the three months ended June 30, 2019. The increase in provision for loan losses primarily resulted from an increase based on the additional variability surrounding the loan modifications made during the three months ended June 30, 2020 and increased economic uncertainty.
The six months ended June 30, 2020 compared with the six months ended June 30, 2019. We reported net income available to common shareholders of $10.0 million for the six months ended June 30, 2020, compared to $3.0 million of net income available to common shareholders for the six months ended June 30, 2019, a $7.0 million, or 230.9%, increase. For the six months ended June 30, 2020, our income before income tax was $13.1 million, a $ 9.0 million, or 219.2%, increase from the six months ended June 30, 2019. The increase was primarily driven by a $7.9 million increase in net gain on mortgage loans, a $3.8 million increase in net interest income, offset partially by a $2.4 million increase in provision for loan losses.
Net Interest Income
The three months ended June 30, 2020 compared with the three months ended June 30, 2019. For the three months ended June 30, 2020, net interest income, before the provision for loan losses was $10.8 million, an increase of $2.8 million, or 35.6%, compared to the three months ended June 30, 2019. This increase was primarily driven by a $333.8 million increase in average outstanding loan balances compared to June 30, 2019, along with a decrease in our cost of funds to 0.48% from 1.29%. For the three months ended June 30, 2020, our net interest margin was 3.10% and our net interest spread was 2.92%. For the three months ended June 30, 2019, our net interest margin was 3.10% and our net interest spread was 2.67%.
The six months ended June 30, 2020 compared with the six months ended June 30, 2019. For the six months ended June 30, 2020, net interest income, before the provision for loan losses was $19.7 million, an increase of $3.8 million, or 23.8%, compared to the six months ended June 30, 2019. This increase was partially attributable to a $216.9 million increase in average outstanding loan balances compared to June 30, 2019, along with a decrease in our cost of funds to 0.68% from 1.27%. For the six months ended June 30, 2020, our net interest margin was 3.11% and our net interest spread was 2.87%. For the six months ended June 30, 2019, our net interest margin was 3.06% and our net interest spread was 2.64%.
The increase in average loans outstanding for the three and six months ended June 30, 2020 compared to the same periods in 2019 was due to three primary factors: organic growth, PPP loan originations and the Branch Acquisition. PPP loan originations and the Branch Acquisition contributed $0.6 million and $0.7 million respectively to net interest income for the three and six months ended June 30, 2020. Loan yields were 3.85% for the three months ended June 30, 2020, compared to 4.53% for the three months ended June 30, 2019. Loan yields were negatively impacted by 27 basis points as a result of PPP loan originations during the three months ended June 30, 2020.
Interest income on our available-for-sale securities portfolio decreased as a result of lower average yield for the three and six months ended June 30, 2020 compared to the same periods in 2019. Our average yield on available-for-sale securities during the three and six months ended June 30, 2020 was 1.84% and 2.00%, a 67 and 48 basis point decrease, compared to the same periods in 2019. Our average available-for-sale securities balance during the three and six months ended June 30, 2020 was $48.6 million and $51.9 million, a decrease of $4.2 million, and an increase of $0.2 million, respectively, compared to the same periods in 2019.
Interest expense on deposits decreased during the three and six months ended June 30, 2020 compared to the same periods in 2019. The decrease was driven primarily by an 84 and 59 basis point decline in cost of deposits for the three and six months ended June 30, 2020 compared to the same periods in 2019. The decrease in cost of deposits was driven by a reduction in deposit rates consistent with the lower interest rate environment. The reduction in cost of deposits was partially offset by an increase in average interest-bearing deposit accounts of $187.8 million and $129.1 million, for the three and six months ended June 30, 2020, compared to the same periods in 2019.
Net interest income is also impacted by changes in the amount and type of interest earning assets and interest bearing liabilities. To evaluate net interest income, we measure and monitor the yields on our loans and other interest earning assets and the costs of our deposits and other funding sources. The following tables present an analysis of net interest income and net interest margin for the periods presented, using daily average balances for each major category of interest-earning assets and interest-bearing liabilities, the interest earned or paid and the average rate earned or paid on those assets or liabilities.