related to our acquisition of PEB and net income, partially offset by the repurchase of $13.5 million of common stock and $2.0 million of cash dividends. In addition, shareholder’s equity was adversely impacted by increasing unrealized losses on available for sale securities reflecting the increase in market interest rates during the year, resulting in a $16.5 million increase in accumulated other comprehensive loss, net of tax from December 31, 2021. During the nine months ended September 30, 2022, the Company repurchased a total of 668,755 shares of its common stock at a total cost of $13.5 million, or $19.15 per share, leaving 73,777 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 Nine Months Ended September 30, 2022 and 2021
Earnings summary. Net income was $7.2 million for the three months ended September 30, 2022, compared to $5.4 million for the three months ended September 30, 2021, an increase of $1.8 million or 33.6%. The increase was the result of a $7.0 million increase in net interest income, partially offset by a $717,000 increase in provision for loan losses, a $1.3 million decrease in noninterest income, a $2.2 million increase in noninterest expense and a $970,000 increase in provision for income taxes. Diluted earnings per share were $0.54 for the three months ended September 30, 2022, compared to diluted earnings per share of $0.51 for the three months ended September 30, 2021.
Net income was $18.9 million for the nine months ended September 30, 2022, compared to $15.3 million for the nine months ended September 30, 2021, an increase of $3.7 million, or 24.1%, primarily as a result of a $16.6 million increase in net interest income and $466,000 increase in noninterest income, partially offset by a $3.9 million increase in provision for loan losses, a $8.3 million increase in noninterest expense and a $1.3 million increase in provision for income taxes. Diluted earnings per share were $1.44 for the nine months ended September 30, 2022, compared to diluted earnings per share of $1.39 for the nine months ended September 30, 2021.
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 58.60% and 62.49% for the three and nine months ended September 30, 2022, compared to 63.82% and 66.40% for the three and nine months ended September 30, 2021. The improvement in the efficiency ratio during the three and nine months ended September 30, 2022 compared to the same period in 2021 was due to higher revenues.
Interest income. Interest income for the three months ended September 30, 2022 was $27.1 million, compared to $20.0 million for the three months ended September 30, 2021, an increase of $7.2 million or 35.9%. The increase in interest income between the periods reflects increases in interest income on loans and, to a lesser extent, investment securities available-for-sale due to increases in the average balances of and yields earned on 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 $5.6 million, or 30.1%, to $24.0 million for the three months ended September 30, 2022, compared to $18.5 million for the three months ended September 30, 2021, primarily due to a $388.8 million increase in average loan balance and a 23 basis point increase 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 September 30, 2022 was 4.73%, compared to 4.50% for the same period in 2021. Interest income on loans for three months ended September 30, 2022 and 2021 included $63,000 and $338,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 $480,000 and $2.3 million at September 30, 2022 and September 30, 2021, respectively. Interest income on loans for three months ended September 30, 2022 and 2021 included $161,000 and $1.1 million, respectively, in fees earned related to PPP loans. As of September 30, 2022, total unrecognized fees on PPP loans were $227,000. Interest income on loans for the three months ended September 30, 2022 and 2021, included $195,000 and $57,000, respectively, in fees related to prepayment penalties.
For the three months ended September 30, 2022, average PPP loans were $50.1 million and the average yield, including fees, was 2.28%. 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.