Total investment securities were $2.57 billion at September 30, 2018, a decrease of $345.6 million, or 11.87%, from $2.91 billion at December 31, 2017. At September 30, 2018, investment securitiesheld-to-maturity (“HTM”) totaled $759.0 million. At September 30, 2018, investment securitiesavailable-for-sale (“AFS”) totaled $1.81 billion, inclusive of apre-tax unrealized loss of $44.5 million. HTM securities declined by $70.9 million, or 8.54%, and AFS securities declined by $274.8 million, or 13.20%, from December 31, 2017.
Total loans and leases, net of deferred fees and discounts, of $7.58 billion at September 30, 2018 increased by $2.75 billion, or 56.97%, from December 31, 2017. Excluding the $2.73 billion of acquired CB loans, total loans increased by $17.7 million or 0.37% for the first nine months of 2018. Commercial real estate loans grew by $98.2 million and construction loans increased by $16.7 million. This growth was partially offset by a decrease of $27.0 million in commercial and industrial loans and a decrease of $55.7 million in dairy & livestock and agribusiness loans. The decline in dairy & livestock and agribusiness loans was due to seasonal dairy borrowings at year end, December 31, 2017.
Noninterest-bearing deposits were $5.22 billion at September 30, 2018, an increase of $1.38 billion, or 35.82%, when compared to December 31, 2017. At September 30, 2018, noninterest-bearing deposits were 57.35% of total deposits, compared to 58.75% at December 31, 2017. Our average cost of total deposits was 0.15% for the quarter ended September 30, 2018, compared with 0.09% for both the second quarter of 2018 and the third quarter of 2017.
Customer repurchase agreements totaled $399.5 million at September 30, 2018, compared to $553.8 million at December 31, 2017. Our average cost of total deposits including customer repurchase agreements was 0.15% for the quarter ended September 30, 2018, compared with 0.11% for the second quarter of 2018 and 0.10% for the third quarter of 2017.
At September 30, 2018, we had $30.0 million in short-term borrowings compared to zero at December 31, 2017. At September 30, 2018, we had $25.8 million of junior subordinated debentures, unchanged from December 31, 2017. These debentures bear interest at three-month LIBOR plus 1.38% and mature in 2036. Our average cost of funds was 0.18% for the quarter ended September 30, 2018, compared to 0.12% for the second quarter of 2018 and 0.12% for the third quarter of 2017.
The allowance for loan losses totaled $60.0 million at September 30, 2018, compared to $59.6 million at December 31, 2017. The allowance for loan losses for the first nine months of 2018 was increased by net recoveries on loans of $1.9 million and was reduced by a $1.5 million loan loss provision recapture. The allowance for loan losses was 0.79% and 1.23% of total loans and leases outstanding, at September 30, 2018 and December 31, 2017, respectively. The ratio as of the most recent quarter was impacted by the $2.73 billion in loans acquired from Community Bank that are recorded at fair market value, without a corresponding loan loss allowance.
Our capital ratios under the revised capital framework referred to as Basel III remain well-above regulatory standards. As of September 30, 2018, the Company’s Tier 1 leverage capital ratio totaled 12.52%, our common equity Tier 1 ratio totaled 12.94%, our Tier 1 risk-based capital ratio totaled 13.22%, and our total risk-based capital ratio totaled 14.00%. Refer to ourAnalysis of Financial Condition – Capital Resources for discussion of the new capital rules, which were effective beginning with the first quarter ended March 31, 2015.
Recent Acquisition
On August 10, 2018, we completed the acquisition of CB with approximately $4.09 billion in total assets and 16 banking centers. The increase in total assets at September 30, 2018 included $2.73 billion of acquired loans, net of an $86.7 million discount, $717.0 million of investment securities, and $70.9 million in bank-owned life insurance. The acquisition resulted in approximately $546.3 million of goodwill and $52.2 million in core deposit premium. At the close of the merger, the entire CB security portfolio was liquidated at fair market value, as was $297.6 million of FHLB term advances and $166.0 million of overnight borrowings assumed from CB. These fair values are estimates and are subject to adjustment for up to one year after the acquisition date or when additional information relative to the closing date fair values becomes available and such information is considered final, whichever is earlier.
We have included the financial results of the business combination in the condensed consolidated statement of earnings and comprehensive income beginning on the acquisition date
47