The decline in the loan portfolio, coupled with the low rate environment continues to put pressure on our net interest income. The loan portfolio yield is declining as the existing portfolio reprices. Lowering our cost of funds, to the extent we can, and continuing to shift the mix of our deposits will help to partially mitigate the unfavorable impact of weak loan demand and repricing, although the impact is expected to be minimal.
The net interest margin for the third quarter of 2012 was 3.82%, an increase of 5 basis points from the second quarter of 2012 and a decline of 38 basis points from the third quarter of 2011. Year-to-date net interest margin of 3.81% declined 37 basis points from the comparable period in 2011. The increase in margin compared to the linked quarter reflects a lower level of earning assets and higher interest recoveries. The decrease in the margin compared to the third quarter of 2011 and year-to-date is attributable to the shift in our earning asset mix and unfavorable asset repricing, partially offset by a lower average cost of funds.
The provision for loan losses for the third quarter of 2012 was $2.9 million compared to $5.7 million in the second quarter of 2012 and $3.7 million for the third quarter of 2011. The decrease from both periods was driven by slower problem loan migration and lower net charge-offs resulting in a favorable impact on our general reserve allocation. For the first nine months of 2012, the loan loss provision totaled $13.4 million compared to $11.4 million for the same period in 2011 with the increase primarily attributable to an increase in impaired loans. Net charge-offs for the third quarter of 2012 totaled $2.6 million, or 0.66%, of average loans (annualized) compared to $7.0 million, or 1.80%, for the second quarter of 2012 and $5.1 million, or 1.22%, in the third quarter of 2011. For the first nine months of 2012, net charge-offs totaled $14.2 million, or 1.21%, of average loans (annualized) compared to $17.2 million, or 1.35%, for the same period of 2011. At quarter-end, the allowance for loan losses of $30.2 million was 1.97% of outstanding loans (net of overdrafts) and provided coverage of 41% of nonperforming loans compared to 1.93% and 40%, respectively, at June 30, 2012, and 1.91% and 41%, respectively, at December 31, 2011.