| (v) | the objectives of our asset/liability management program. |
Excess liquid assets are invested generally in interest-earning deposits or securities and may also be used to pay off short-term borrowings.
Our most liquid asset is cash. The amount of this asset is dependent on our operating, financing, lending and investing activities during any given period. At December 31, 2020, the Company’s cash and cash equivalents totaled $363.5 million.
If we require funds beyond our ability to generate them internally, borrowing agreements exist with the FHLB, which provide an additional source of funds. We also utilize securities sold under agreements to repurchase as another borrowing source. At December 31, 2020, we had the ability to borrow up to an additional $807.2 million from the FHLB. Advances from the FHLB and securities sold under agreements to repurchase were $141.0 million and $10.0 million, respectively, at December 31, 2020. In 2020, FHLB advances decreased by $15.0 million while securities sold under agreements to repurchase remained constant.
At December 31, 2020 we did not have any standby letters of credit from the FHLB. At December 31, 2019, we had $55.0 million in standby letters of credit from the FHLB pledged as collateral for State of Hawaii deposits.
Our cash flows are derived from operating activities, investing activities and financing activities as reported in our Consolidated Statements of Cash Flows included in our Consolidated Financial Statements.
At December 31, 2020, we had $21.3 million in loan commitments outstanding, most of which were for fixed-rate loans. In addition to commitments to originate loans, we had $20.7 million in unused lines of credit to borrowers. Certificates of deposit due within one year of December 31, 2020 totaled $221.6 million, or 13.4% of total deposits. If these deposits do not remain with us, we may be required to seek other sources of funds, including loan sales, brokered deposits, securities sold under agreements to repurchase and FHLB advances. Depending on market conditions, we may be required to pay higher rates on such deposits or other borrowings than we currently pay on the certificates of deposit due on or before December 31, 2021. We believe, however, based on past experience that a significant portion of such deposits will remain with us. We have the ability to attract and retain deposits by adjusting the interest rates offered.
Our primary investing activities are originating loans and purchasing mortgage-backed securities. During the years ended December 31, 2020 and 2019, we originated $292.3 million and $249.1 million of loans, respectively. In 2020 we did not purchase any securities. In 2019, we purchased $9.2 million of securities.
Financing activities consist primarily of activity in deposit accounts, FHLB advances, securities sold under agreements to repurchase, stock repurchases and dividend payments. We experienced net increases in deposits of $27.9 million and $2.8 million for the years ended December 31, 2020 and 2019, respectively. Deposit flows are affected by the overall level of interest rates, the interest rates and products offered by us and our local competitors, and by other factors.
As a separate legal entity, the Company is required to have liquidity to fund stock repurchases and dividend payments to shareholders and for other corporate purposes. As of December 31, 2020, due to the uncertainty surrounding the COVID-19 pandemic, we have not announced a new share repurchase program. Shares repurchased reduce the amount of shares issued and outstanding. The repurchased shares may be reissued in connection with share-based compensation plans and for general corporate purposes. During the years ended December 31, 2020 and 2019, the Company repurchased 204,324 and 59,700 shares of common stock, respectively, at an average cost of $24.47 and $26.74, respectively, as part of the repurchase programs authorized by the Board of Directors. At December 31, 2020 and 2019, on a stand-alone basis, the Company had cash in banks of $18.1 million and $22.6 million, respectively.
Territorial Savings Bank and the Company are subject to various regulatory capital requirements, including a risk-based capital measure. The risk-based capital guidelines include both a definition of capital and a framework for calculating risk-weighted assets by assigning balance sheet assets and off-balance sheet items to broad risk categories. At December 31, 2020, Territorial Savings Bank and the Company exceeded all regulatory capital requirements and are considered to be “well capitalized” under regulatory guidelines. See Note 23 of the Notes to Consolidated Financial Statements.