to our acquisition of PEB and net income, partially offset by the repurchase of $5.7 million of common stock and $1.4 million of cash dividends. In addition, shareholder’s equity was adversely impacted by a $11.4 million decrease in accumulated other comprehensive income during the six months ended June 30, 2022 resulting in a total accumulated other comprehensive loss of $9.2 million, net of tax, due to an increase in the unrealized loss on available for sale securities reflecting the increase in market interest rates during the six months ended June 30, 2022. During the six months ended June 30, 2022, the Company repurchased a total of 262,221 shares of its common stock at a total cost of $5.7 million, or $21.69 per share, leaving 480,311 shares available for future purchases under the current stock repurchase plan. For additional information see Part II, Item 2, “Unregistered Sales of Equity Securities and Use of Proceeds”.
Comparison of Results of Operations for the Three and Six Months Ended June 30, 2022 and 2021
Earnings summary. Net income was $5.2 million for the three months ended June 30, 2022, compared to $5.3 million for the three months ended June 30, 2021, a decrease of $90,000 or 1.7%. The decrease was the result of a $3.1 million increase in provision for loan losses, a $432,000 decrease in noninterest income, and a $1.8 million increase in noninterest expense, partially offset by a $5.4 million increase in net interest income. Diluted earnings per share were $0.38 for the three months ended June 30, 2022, a decrease of $0.11 from diluted earnings per share of $0.49 for the three months ended June 30, 2021.
Net income was $11.7 million for the six months ended June 30, 2022, compared to $9.8 million for the six months ended June 30, 2021, an increase of $1.9 million, or 19.0%, primarily as a result of a $9.7 million increase in net interest income, and a $1.7 million increase in noninterest income, partially offset by a $3.1 million increase in provision for loan losses and a $6.0 million increase in noninterest expense.
Our efficiency ratio, which is calculated by dividing noninterest expense by the sum of net interest income before provision for loan losses and noninterest income, was 60.38% and 64.56% for the three and six months ended June 30, 2022, compared to 66.27% and 67.79% for the three and six months ended June 30, 2021, respectively. The improvement in the efficiency ratio during the three and six months ended June 30, 2022 compared to the same period in 2021 was due to higher revenues.
Interest income. Interest income for the three months ended June 30, 2022 was $25.6 million, compared to $20.0 million for the three months ended June 30, 2021, an increase of $5.6 million or 28.1%. The increase in interest income between the periods reflects increases in interest income on loans and, to a lesser extent, investment securities due to increases in the average balances of these portfolios, partially offset by lower recognition of deferred loan fee income from SBA loan forgiveness related to PPP loans.
Interest income on loans, including fees, increased $4.3 million, or 22.9%, to $23.0 million during the three months ended June 30, 2022, compared to $18.7 million for the three months ended June 30, 2021, primarily due to a $402.3 million increase in average loan balance, partially offset by a nine basis point decrease in the average yield. The average yield on loans, including the accretion of the net discount and deferred PPP loan fees recognized for the three months ended June 30, 2022 was 4.62%, compared to 4.71% for the same period in 2021. Interest income on loans for three months ended June 30, 2022 and 2021 included $198,000 and $363,000, respectively, in accretion of the net discount on acquired loans and revenue from purchase credit impaired loans in excess of discounts. The remaining net discount on these acquired loans was $481,000 and $2.3 million at June 30, 2022 and June 30, 2021, respectively. Interest income for the three months ended June 30, 2022 included $351,000 in fees earned related to PPP loans compared to $1.5 million during the three months ended June 30, 2021. As of June 30, 2022, total unrecognized fees on PPP loans were $388,000. Interest income on loans for the three months ended June 30, 2022 and 2021, included $487,000 and $152,000, respectively, in fees related to prepayment penalties.
For the three months ended June 30, 2022, average PPP loans were $91.0 million and the average yield, including fees, was 2.55%. The impact of PPP loans on loan yields will change during any period based on the volume of prepayments or amounts forgiven by the SBA as certain criteria are met, but will cease completely after the maturity of the loans. Approximately two-thirds of the PPP loans are set to mature by the end of 2022, while the remaining loans have a five-year maturity date.