image_1.jpg
Daniel I. Goldberg
+1 212 479 6722
dgoldberg@cooley.com
EXHIBIT 5.1

December 9, 2022                                    
X4 Pharmaceuticals, Inc.
61 North Beacon Street, 4th Floor
Boston, MA 02134

Ladies and Gentlemen:

We have acted as counsel to X4 Pharmaceuticals, Inc., a Delaware corporation (the “Company”), in connection with the offering by the Company of (i) 61,165,000 shares (the “Shares”) of common stock, par value $0.001 per share, of the Company (the “Common Stock”), (ii) pre-funded warrants (the “Pre-Funded Warrants”) to purchase up to 6,800,000 shares of Common Stock, and (iii) warrants to purchase shares of the Common Stock, or in lieu of such shares Pre-Funded Warrants (such shares and shares underlying Pre-Funded Warrants totaling up to 33,982,500 shares of Common Stock) (the “Class C Warrants” and together with the Pre-Funded Warrants, the “Warrants” and, any shares issuable upon the conversion thereof, the “Warrant Shares”), pursuant to a Registration Statement on Form S-3 (Registration No. 333-249544) (the “Registration Statement”), filed with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”), the base prospectus included in the Registration Statement (the “Base Prospectus”) and the prospectus supplement dated December 7, 2022, filed with the Commission pursuant to Rule 424(b) under the Act (together with the Base Prospectus, the “Prospectus”).
In connection with this opinion, we have examined and relied upon the Registration Statement, the Prospectus, the forms of Pre-Funded Warrant and Class C warrant to be filed as exhibits to a current report of the Company on Form 8-K, the Company’s certificate of incorporation and bylaws, each as currently in effect, and originals or copies certified to our satisfaction of such other records, documents, certificates, memoranda and other instruments as in our judgment are necessary or appropriate to enable us to render the opinion expressed below. We have assumed the genuineness of all signatures; the authenticity of all documents submitted to us as originals; the conformity to originals of all documents submitted to us as copies; the accuracy, completeness and authenticity of certificates of public officials; and the due authorization, execution and delivery of all documents by all persons other than the Company where authorization, execution and delivery are prerequisites to the effectiveness of such documents. As to certain factual matters, we have relied upon a certificate of an officer of the Company and have not independently verified such matters.

Our opinion is expressed only with respect to the General Corporation Law of the State of Delaware and, as to the Warrants constituting valid and binding obligations of the Company, the laws of the State of New York. We express no opinion to the extent that any other laws are applicable to the subject matter hereof and express no opinion and provide no assurance as to compliance with any federal or state securities law, rule or regulation.






Cooley LLP 55 Hudson Yards New York, NY 10001-2157
t: (212) 479-6000 f: (212) 479-6275 cooley.com
278113308 v4


image_1.jpg


With regard to our opinion concerning the Warrants constituting valid and binding obligations of the Company:
(i)     Our opinion is subject to, and may be limited by, (a) applicable bankruptcy, reorganization, insolvency, moratorium, fraudulent conveyance, debtor and creditor, and similar laws which relate to or affect creditors' rights generally, and (b) general principles of equity (including, without limitation, concepts of materiality, reasonableness, good faith and fair dealing) regardless of whether considered in a proceeding in equity or at law.
(ii)     Our opinion is subject to the qualification that the availability of specific performance, an injunction or other equitable remedies is subject to the discretion of the court before which the request is brought.
(iii)     We express no opinion as to any provision of the Warrants that: (a) provides for liquidated damages, buy-in damages, monetary penalties, prepayment or make-whole payments or other economic remedies to the extent such provisions may constitute unlawful penalties, (b) relates to advance waivers of claims, defenses, rights granted by law, or notice, opportunity for hearing, evidentiary requirements, statutes of limitations, trial by jury, or procedural rights, (c) restricts non-written modifications and waivers, (d) provides for the payment of legal and other professional fees where such payment is contrary to law or public policy, (e) relates to exclusivity, election or accumulation of rights or remedies, or (f) provides that provisions of the Warrants are severable to the extent an essential part of the agreed exchange is determined to be invalid and unenforceable.
(iv)     We express no opinion as to whether a state court outside of the State of New York or a federal court of the United States would give effect to the choice of New York law provided for in the Warrants.
With respect to the Warrant Shares, we express no opinion to the extent that future issuances of securities, of the Company and/or adjustments to outstanding securities of the Company cause the Warrants to be exercisable for more shares of Common Stock than the number that remain available for issuance. Further, we have assumed the exercise price of the Warrants will not be adjusted to an amount below the par value per share of the Common Stock.
On the basis of the foregoing, and in reliance thereon, we are of the opinion that (i) the Shares, when sold and issued in accordance with the Registration Statement and the Prospectus, will be validly issued, fully paid and nonassessable, (ii) the Warrants, when duly executed and delivered by the Company and duly delivered to the purchasers thereof against payment therefor as contemplated in the Registration Statement and the Prospectus, will be valid and binding obligations of the Company, and (iii) the Warrant Shares, when sold and issued against payment therefor in accordance with the terms of the Warrants, will be validly issued, fully paid and nonassessable.

Our opinion is limited to the matters stated herein and no opinion is implied or may be inferred beyond the matters expressly stated. Our opinion is based on these laws as in effect on the date hereof, and we disclaim any obligation to advise you of facts, circumstances, events or developments which hereafter may be brought to our attention and which may alter, affect or modify the opinion expressed herein.

Cooley LLP 55 Hudson Yards New York, NY 10001-2157
t: (212) 479-6000 f: (212) 479-6275 cooley.com


image_1.jpg



We consent to the reference to our firm under the caption “Legal Matters” in the Prospectus and to the filing of this opinion as an exhibit to a current report of the Company on Form 8-K to be filed with the Commission for incorporation by reference into the Registration Statement. In giving such consent, we do not thereby 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 of the Commission thereunder.

[Signature page follows]
Cooley LLP 55 Hudson Yards New York, NY 10001-2157
t: (212) 479-6000 f: (212) 479-6275 cooley.com


image_1.jpg

Very truly yours,

Cooley llp
By:     /s/ Daniel I. Goldberg        
    Daniel I. Goldberg, Partner





Cooley LLP 55 Hudson Yards New York, NY 10001-2157
t: (212) 479-6000 f: (212) 479-6275 cooley.com
278113308 v4