$53.5 million during the three months ended September 30, 2020. The average cost of borrowing increased to 5.42% for the three months ended September 30, 2021, compared to 4.86% for the three months ended September 30, 2020.
Interest expense increased by $89,000, or 1.4%, to $6.6 million for the nine months ended September 30, 2021 compared to $6.5 million for the nine months ended September 30, 2020 as a result of the costs from the issuance of subordinated debt in August 2020 exceeding decreased deposit costs from the decline in the average rate paid on interest bearing deposits. The average cost of interest bearing liabilities decreased four basis points to 0.68% for the nine months ended September 30, 2021 compared to 0.72% for the nine months ended September 30, 2020. Total average interest bearing liabilities increased $98.2 million, or 8.16%, to $1.3 million for the nine months ended September 30, 2021 from $1.2 million for the nine months ended September 30, 2020.
Interest expense on deposits decreased $1.9 million, or 34.0%, to $3.7 million during the nine months ended September 30, 2021 from $5.6 million the same period in 2020, primarily as a result of a decline in the average rate paid on interest bearing deposits and a $51.9 decrease in the average balance of higher interest bearing time deposits. The average rate paid on interest bearing deposits decreased by 23 basis points to 0.40% for the nine months ended September 30, 2021 compared to 0.63% for the nine months ended September 30, 2020.
The overall average cost of deposits for the nine months ended September 30, 2021 declined to 0.25%, compared to 0.32% for the nine months ended September 30, 2020 due to an increase in noninterest bearing deposits and a reduction in market interest rates over the last year. The average balance of noninterest bearing deposits increased $59.9 million, or 9.1%, to $721.0 million for the nine months ended September 30, 2021 compared to $661.1 million for the nine months ended September 30, 2020.
Interest expense on borrowings increased $2.0 million, or 198.8%, to $2.9 million for the nine months ended September 30, 2021, from $968,000 for the nine months ended September 30, 2020, as a result of a higher average balance of borrowings outstanding due to the issuance of the subordinated debt in August 2020. The average balance of borrowing outstanding increased $49.1 million to $74.1 million during the nine months ended September 30, 2021, compared to $25.0 million during the nine months ended September 30, 2020. The average cost of borrowing increased to 5.32% for the nine months ended September 30, 2021, compared to 5.17% for the nine months ended September 30, 2020.
Net interest income and net interest margin. Net interest income decreased $1.3 million, or 6.7%, to $17.7 million for the three months ended September 30, 2021, compared to $19.0 million for the three months ended September 30, 2020, and decreased $6.4 million to $53.6 million for the nine months ended September 30, 2021, compared to $60.0 million for the nine months ended September 30, 2020. The decrease in net interest income during the three months ended September 30, 2021 compared to the same period in 2020 was primarily due to the decline in the average loan balance between periods, while the decrease during the nine months ended September 30, 2021 compared to the same period in 2020 was primarily due to the decline in the average yield on interest earning assets.
The average yield on interest earning assets for the three months ended September 30, 2021 was 3.57%, a 44 basis point decrease from 4.01% for the three months ended September 30, 2020, due primarily to lower market interest rates, while the average cost of interest bearing liabilities for the three months ended September 30, 2021 decreased to 0.66%, or four basis points from 0.70% for the three months ended September 30, 2020. The average yield on interest earning assets for the nine months ended September 30, 2021 was 3.72%, a 68 basis point decrease from 4.40% for the nine months ended September 30, 2020, while the average cost of interest bearing liabilities for the nine months ended September 30, 2021 decreased to 0.68%, or four basis points from 0.72% for the nine months ended September 30, 2020, due primarily to lower market interest rates, partially offset by the cost of the subordinated debt.
The net interest margin for the three and nine months ended September 30, 2021 was 3.17% and 3.51%, respectively, compared to 3.59% and 3.96% for the three and nine months ended September 30, 2020. During the three and nine months ended September 30, 2021, the interest margin was impacted by lower yielding loans, including PPP loans and resetting adjustable rate instruments as well as reduced interest rates on new fixed-rate real estate loan and adjustable-rate commercial loan originations and the increase in low yielding overnight cash balances causing a decrease in the average yield on interest-earning assets that outweighed the contribution to net interest margin from the decrease in the average cost of interest-bearing liabilities. The decrease in net interest margin was offset partially by an increase in deferred SBA PPP loan fees recognized due to the volume of forgiven SBA PPP loans during the three and nine months