substantially all of the proceeds from the tranche A term loan to repay in full all outstanding amounts owed under the Athyrium Credit Facility, under which we had an aggregate principal amount of $75.0 million of indebtedness outstanding. We terminated all commitments by Athyrium to extend further credit under the Athyrium Credit Facility and all guarantees and security interests granted by us thereunder. In connection with the termination of the Athyrium Credit Facility, we paid to the lenders a prepayment premium of $2.25 million and an exit fee of $0.8 million. The transaction resulted in a loss on extinguishment of debt of $5.4 million, consisting of the prepayment premium, the unamortized debt discount and the unaccreted exit fee.
On October 5, 2018, we sold 7,500,000 shares of common stock in an underwritten offering pursuant to the 2018 Shelf Registration at a public offering price of $8.25 per share, before underwriting discounts and commissions. In addition, the underwriters were granted an overallotment option to purchase an additional 1,125,000 shares of the common stock at the same public offering price, less underwriting discounts and commissions. On October 11, 2018, the underwriters exercised in full their option to purchase the overallotment shares. The total number of shares sold by us in the offering was 8,625,000 shares, resulting in net proceeds to us, after underwriting discounts and offering expenses, of $66.1 million. In connection with the filing of the 2018 Shelf Registration, we entered into a sales agreement with Jefferies, pursuant to which we could issue and sell, from time to time, up to an aggregate of $50.0 million of our common stock in an ATM Offering, through Jefferies, as sales agent. Through the first quarter of 2020, we issued an aggregate of 4,945,605 shares of our common stock under the ATM Offering, resulting in net proceeds to us of $25.6 million. On March 10, 2020, we suspended and terminated the prospectus related to the ATM Offering.
On March 11, 2020, we sold 16,000,000 shares of our common stock in an underwritten offering pursuant to the 2018 Shelf Registration at a public offering price of $7.89 per share, resulting in net proceeds of $118.2 million, after underwriting discounts, commissions, and offering expenses. In addition, the underwriters of the offering were granted the option for a period of 30 days to purchase up to an additional 2,400,000 shares of common stock offered in the public offering at the public offering price, less underwriting discounts, commissions and offering expenses. On April 3, 2020, the underwriters exercised their option and purchased an additional 979,371 shares of common stock at $7.89 per share, resulting in net proceeds to us of $7.2 million, after underwriting discounts, commissions, and offering expenses. The total number of shares sold by us in the offering was 16,979,371, resulting in total net proceeds to us, after underwriting discounts, commissions and offering expenses, of $125.4 million.
Under the 2018 Shelf Registration, which has now expired, we issued an aggregate of 30,549,976 shares of common stock, including under the ATM Offering, resulting in aggregate gross proceeds to us of $231.7 million.
On May 7, 2020, we filed our shelf registration statement on Form S-3 that was declared effective by the SEC on May 7, 2020, or the 2020 Shelf Registration, under which we may offer and sell up to $350.0 million of a variety of securities including common stock, preferred stock, warrants, depositary shares, debt securities or units during the three-year period that commenced upon the 2020 Shelf Registration becoming effective. In connection with the filing of the 2020 Shelf Registration, we entered into an amended and restated sales agreement with Jefferies, pursuant to which we may issue and sell, from time to time, up to an aggregate of $75.0 million of our common stock under our ATM Offering. Through December 31, 2021, we issued and sold an aggregate of 8,581,257 shares of our common stock under the ATM Offering, resulting in net proceeds of $61.8 million, which included 4,746,072 shares of common stock issued and sold during the three months ended March 31, 2021 resulting in net proceeds of $34.7 million. We did not sell any shares of our common stock under the ATM Offering during the three months ended March 31, 2022. As of March 31, 2022, there was $11.3 million of shares of common stock remaining under the ATM Offering that we may issue and sell in the future and, excluding the shares of common stock that may be offered under our ATM Offering, there was $275.0 million of securities available to be issued under the 2020 Shelf Registration.
On May 4, 2021, we entered into the Loan Agreement with Oxford Finance, in its capacity as lender, or the Lender, and in its capacity as collateral agent, pursuant to which a term loan of up to an aggregate principal amount of $125.0 million is available to us, consisting of (i) a tranche A term loan that was disbursed on the closing date of the Loan Agreement in the aggregate principal amount of $80.0 million; (ii) a contingent tranche B term loan in the aggregate principal amount of $20.0 million available to us through June 30, 2023 and within 90 days of our achieving trailing 6-month product revenue equal to or greater than $75.0 million, subject to certain other terms and conditions; and (iii) a contingent tranche C term loan in the aggregate principal amount of $25.0 million available to us through