obligations. Securities available for sale decreased $3.4 million, or 3.2%, to $101.1 million at March 31, 2021 from $104.5 million at December 31, 2020. The decrease was due primarily to $2.4 million in principal collections on federal agency mortgage-backed securities and a $2.0 million decrease in the gross unrealized gain in the portfolio, partially offset by purchases of $1.1 million in municipal obligations.
Securities Held to Maturity. Our held to maturity securities portfolio consists of U.S. government agency mortgage-backed securities. Securities held to maturity decreased $3,000, or 9.7%, to $28,000 at March 31, 2021 from $31,000 at December 31, 2020 due primarily to principal repayments of mortgage-backed securities.
Deposits. Deposit accounts, primarily obtained from individuals and businesses throughout our local market area, are the primary source of funds for our lending and investments. Our deposit accounts are comprised of noninterest-bearing checking, interest-bearing checking, savings, and money market accounts and certificates of deposit. Deposits increased $12.1 million, or 7.0%, to $186.2 million at March 31, 2021 from $174.1 million at December 31, 2020.
Borrowings. On June 27, 2019, the Company borrowed $10.0 million from the FHLB which matures on June 27, 2024 and bears interest at a rate of 1.73%. On December 30, 2020, the Company borrowed $1.0 million from the FHLB, bearing an interest rate of 0.26% and matured on January 6, 2021.
Stockholders’ Equity. Stockholders’ equity decreased $1.1 million to $47.9 million at March 31, 2021 from $49.0 million at December 31, 2020. The decrease was due primarily to a $1.5 million decrease in accumulated other comprehensive income, net of tax, due primarily to decreases in the fair market value of our available-for-sale investments, and dividends of $91,000, partially offset by net income of $378,000 for the three months ended March 31, 2021.
Comparison of Results of Operations for the Three Months Ended March 31, 2021 and 2020
Net Income. Net income was $378,000 ($0.13 per common share diluted) for the three months ended March 31, 2021, compared to net income of $385,000 ($0.12 per common share diluted) for the three months ended March 31, 2020. The primary reason for the decrease in net income between the periods was increased noninterest expenses partially offset by increased noninterest income and net interest income.
Net Interest Income. Net interest income after provision for loan losses increased $82,000, or 5.1%, to $1.7 million for the three months ended March 31, 2021 compared to $1.6 million for the three months ended March 31, 2020 due primarily to a decrease in the yield earned on interest-earning assets partially offset by an increase in the average balance of interest-earning assets.
Total interest income decreased $68,000, or 3.5%, to $1.9 million for the three months ended March 31, 2021 as compared to the same period in 2020. The decrease resulted from a decrease in the yield earned on interest-earning assets partially offset by an increase in the average balance of interest-earning assets. The average tax equivalent yield on interest-earning assets declined to 3.43% for the quarter ended March 31, 2021 from 3.98% for the quarter ended March 31, 2020, due primarily to a decrease in market interest rates. The average balance of interest-earning assets increased to $228.8 million for the quarter ended March 31, 2021 from $200.4 million for the quarter ended March 31, 2020, due primarily to increases in investment securities, partially offset by decreases in loans receivable and cash and cash equivalents.
Total interest expense decreased $93,000, or 35.4%, to $170,000 for the three months ended March 31, 2021 compared to $263,000 for the three months ended March 31, 2020 due to a decrease in the average cost of interest-bearing liabilities, partially offset by an increase in the average balance of interest-bearing liabilities. The average cost of interest-bearing liabilities decreased to 0.42% for the quarter ended March 31, 2021 from 0.76% for the same period in 2020. The average balance of interest-bearing liabilities increased to $163.0 million for the quarter ended March 31, 2021 from $139.0 million for the same period in 2020. The average cost of deposits decreased to 0.33% for the quarter ended March 31, 2021 from 0.68% for the same period in 2020. The market’s response to lowering deposit pricing to reflect the targeted federal funds rate decreases over the past year typically lags declines in the yield on interest earning assets. As a result of the changes in interest-earning assets and interest-bearing liabilities, the interest rate spread decreased to 3.01% from 3.22% and the net interest margin decreased to 3.13% from 3.46% for the quarters ended March 31, 2021 and 2020, respectively.