Attached files

file filename
S-1/A - S-1/A - Amphastar Pharmaceuticals, Inc.a2220476zs-1a.htm
EX-23.1 - EX-23.1 - Amphastar Pharmaceuticals, Inc.a2220476zex-23_1.htm

QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1


LOGO
  K&L GATES LLP
1 PARK PLAZA
TWELFTH FLOOR
IRVINE, CA 92614
T +1 949 253 0900    F +1 949 253 0902 klgates.com

June 10, 2014

Amphastar Pharmaceuticals, Inc.
11570 6th Street
Rancho Cucamonga, California 91730

Ladies and Gentlemen:

        We have acted as counsel for Amphastar Pharmaceuticals, Inc., a Delaware corporation (the "Company") in connection with the Registration Statement on Form S-1 (File No. 333-196097) (the "Registration Statement") filed with the Securities and Exchange Commission (the "Commission") under the Securities Act of 1933 (the "Securities Act") for the registration of 8,464,000 shares of the Company's Common Stock, par value $0.0001 per share of which up to 5,104,000 shares (which includes 1,104,000 shares subject to the underwriters' option to purchase additional shares to cover over-allotments) (the "Company Shares") are being offered by the Company and 3,360,000 shares (the "Selling Stockholder Shares" and, together with the Company Shares, the "Shares") are being offered by a certain selling stockholder of the Company identified in the Prospectus.

        You have requested our opinion as to the matters set forth below in connection with the Registration Statement. For purposes of rendering that opinion, we have examined: (i) the Registration Statement; (ii) the most recent prospectus included in the Registration Statement on file with the Commission as of the date of this opinion letter; (iii) the form of Amended and Restated Certificate of Incorporation of the Company and the form of Amended and Restated Bylaws of the Company, each of which have been filed with the Commission as an exhibit to the Registration Statement; and (iv) the records of corporate actions of the Company relating to the Registration Statement and the authorization for issuance and sale of the Shares, and matters in connection therewith. We have also made such other investigation as we have deemed appropriate. We have examined and relied upon certificates of public officials and, as to certain matters of fact that are material to our opinion, we have also relied on a certificate of an officer of the Company. In rendering our opinion, we also have made the assumptions that are customary in opinion letters of this kind. We have not verified any of those assumptions.

        Our opinion set forth below is limited to the Delaware General Corporation Law, including the applicable provisions of the Delaware Constitution and reported judicial decisions interpreting those laws.

        Based upon and subject to the foregoing, it is our opinion that:

    The Company Shares are duly authorized for issuance by the Company and, when issued and paid for in accordance with a definitive underwriting agreement approved by the Board of Directors of the Company, or a committee thereof, will be validly issued, fully paid and nonassessable.

    The Selling Stockholder Shares are validly issued, fully paid and nonassessable.

        We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to this firm in the related Prospectus under the caption "Legal Matters." In giving our consent we do not hereby admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations thereunder.

Yours truly,

/s/ K&L Gates LLP

K&L Gates LLP




QuickLinks