Please wait

Exhibit 5.1

Graphic

May 22, 2025

Board of Directors

John Marshall Bancorp, Inc.

1943 Isaac Newton Square, Suite 100

Reston, Virginia 20190

Re:Registration Statement on Form S-3

Ladies and Gentlemen:

We have acted as counsel to John Marshall Bancorp, Inc., a Virginia corporation (the “Company”), in connection with the registration statement on Form S-3 (the “Registration Statement”) to be filed on the date hereof by the Company with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”). The Registration Statement relates to the issuance and sale by the Company from time to time, pursuant to Rule 415 of the General Rules and Regulations promulgated under the Securities Act, of the following securities with a proposed maximum aggregate offering price of up to $80,000,000: (i) shares of common stock, par value $0.01 per share, of the Company (the “Common Shares”); (ii) shares of preferred stock, par value $0.01 per share, of the Company (the “Preferred Shares”), which may be issued in one or more classes or series; (iii) depositary shares representing fractional interests in the Preferred Shares evidenced by depositary receipts (the “Depositary Shares”) issued pursuant to one or more deposit agreements between the Company and a bank or trust company, as depositary (each, a “Depositary Agreement”); (iv) senior debt securities (the “Senior Debt Securities”) and subordinated debt securities (the “Subordinated Debt Securities” and, together with the Senior Debt Securities, the “Debt Securities”), each of which may be issued in one or more series; (v) warrants (the “Warrants”) to purchase Common Shares, Preferred Shares or Debt Securities, which may be issued pursuant to one or more warrant agreements (the “Warrant Agreements”); (vi) purchase contracts (the “Purchase Contracts”) for the purchase or sale of Common Shares, Preferred Shares or Debt Securities, which may be issued under one or more purchase contract agreements (the “Purchase Contract Agreements”) to be entered into between the Company and the purchase contract agent to be named therein; (vii) rights to purchase Common Shares or Preferred Shares (the “Rights”); and (viii) units (the “Units”) each comprised of any combination of Common Shares, Preferred Shares, Debt Securities, Warrants and Purchase Contracts. The Common Shares, Preferred Shares, Depositary Shares, Debt Securities, Warrants, Purchase Contracts, Rights and Units are collectively referred to herein as the “Offered Securities.”

Any Senior Debt Securities are to be issued pursuant to the Senior Indenture (the “Senior Indenture”) to be entered into between the Company and a trustee to be named in the Senior Indenture and duly qualified under the Trust Indenture Act of 1939, as amended (the “Trust Indenture Act”). Any Subordinated Debt Securities are to be issued pursuant to the Subordinated Indenture (the “Subordinated Indenture” and, together with the Senior Indenture, the “Indentures”) to be entered into between the Company and a trustee to be named in the Subordinated Indenture and duly qualified under the Trust Indenture Act. We have assumed that the Indentures will be executed and delivered in substantially the forms reviewed by us and that the choice of New York law to govern each of the Indentures is a valid, legal and enforceable provision.

Williams Mullen Center | 200 South 10th Street, Suite 1600 Richmond, VA 23219 | P.O. Box 1320 Richmond, VA 23218

T 804.420.6000 F 804.420.6507 | williamsmullen.com | A Professional Corporation


John Marshall Bancorp, Inc.

May 22, 2025

Page 2

For purposes of this opinion letter, we have examined copies of such agreements, instruments and documents as we have deemed an appropriate basis on which to render the opinions hereafter expressed. In our examination of the aforesaid agreements, instruments and documents, we have assumed the genuineness of all signatures, the legal capacity of all natural persons, the accuracy and completeness of all documents submitted to us, the authenticity of all original documents, and the conformity to authentic original documents of all documents submitted to us as copies (including, without limitation, PDFs). As to all matters of fact, we have relied on the representations and statements of fact made in the agreements, instruments and documents so reviewed, and we have not independently established the facts so relied on. This opinion letter is given, and all statements herein are made, in the context of and in reliance on the foregoing.

The opinions expressed herein are limited in all respects to the application of the laws of the Commonwealth of Virginia and the State of New York (but not including any statutes, ordinances, administrative decisions, orders, rules and regulations of any municipality, county, special district or other political subdivision of Virginia, New York or any other state).

Based on the foregoing, and subject to the limitations and qualifications set forth herein, it is our opinion that:

1. With respect to any Common Shares to be offered pursuant to the Registration Statement (the “Offered Common Shares”), when certificates representing such Offered Common Shares have been duly executed and delivered by the authorized officers of the Company to the purchasers thereof or appropriate book entries have been made in the records of the Company, against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement (as defined below) relating thereto, such Offered Common Shares, when issued and sold in accordance with the duly authorized, executed and delivered applicable underwriting agreement or any other duly authorized, executed and delivered applicable purchase agreement, or upon conversion, exchange or exercise of any other validly issued Offered Security or the instrument governing such Offered Security providing for such conversion, exchange or exercise, will be legally issued, fully paid and non-assessable.

2. With respect to any class or series of Preferred Shares to be offered pursuant to the Registration Statement (the “Offered Preferred Shares”), when (A) a certificate of amendment to the articles of incorporation of the Company (“Certificate of Amendment”) has been issued by the State Corporation Commission of the Commonwealth of Virginia with respect to the authorization, creation and designation of such Offered Preferred Shares, and (B) certificates representing such Offered Preferred Shares have been duly executed and delivered by the authorized officers of the Company to the purchasers thereof or appropriate book entries have been made in the records of the Company, against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, any Offered Preferred Shares, when issued and sold in accordance with the duly authorized, executed and delivered applicable underwriting agreement or any other duly authorized, executed and delivered applicable purchase agreement, or upon conversion, exchange or exercise of any other validly issued Offered Security or the instrument


John Marshall Bancorp, Inc.

May 22, 2025

Page 3

governing such Offered Security providing for such conversion, exchange or exercise, will be legally issued, fully paid and non-assessable.

3. With respect to any Depositary Shares to be offered pursuant to the Registration Statement (the “Offered Depositary Shares”), when (A) a Certificate of Amendment has been issued by the State Corporation Commission of the Commonwealth of Virginia with respect to the authorization, creation and designation of the Preferred Shares underlying the Offered Depositary Shares (the “Underlying Preferred Shares”), (B) certificates representing such Underlying Preferred Shares have been duly executed and delivered by the authorized officers of the Company to the applicable depositaries, (C) the applicable Depositary Agreement has been duly authorized, executed and delivered by each of the Company and the depositary, (D) the Underlying Preferred Shares have been deposited with the depositary under the Depositary Agreement, and (E) the depositary receipts representing the Offered Depositary Shares have been duly executed and delivered by the authorized officers of the Company to the purchasers thereof or appropriate book entries have been made in the records of the Company, against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, any Offered Depositary Shares, when issued and sold in accordance with the duly authorized, executed and delivered applicable underwriting agreement or any other duly authorized, executed and delivered applicable purchase agreement, will be legally issued, fully paid and non-assessable.

4. With respect to any Debt Securities to be offered pursuant to the Registration Statement (the “Offered Debt Securities”), when (A) the applicable Indenture relating to such Offered Debt Securities has been duly authorized, executed and delivered, and (B) such Offered Debt Securities have been duly executed and authenticated in accordance with the applicable Indenture and duly issued and delivered to the purchasers thereof against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, such Offered Debt Securities, when issued and sold in accordance with the applicable Indenture and the duly authorized, executed and delivered applicable underwriting agreement, if any, or any other duly authorized, executed and delivered valid and binding purchase or agency agreement, will be valid and binding obligations of the Company, enforceable against the Company in accordance with their respective terms.

5. With respect to any Warrants to be offered pursuant to the Registration Statement (the “Offered Warrants”), when (A) a Warrant Agreement has been duly authorized, executed and delivered, and (B) such Offered Warrants have been duly executed and countersigned in accordance with such Warrant Agreement and duly issued and delivered to the purchasers thereof against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, such Offered Warrants, when issued and sold in accordance with the duly authorized, executed and delivered applicable underwriting agreement or any other duly authorized, executed and delivered applicable purchase agreement, will constitute valid and binding obligations of the Company, enforceable against the Company in accordance with their terms.


John Marshall Bancorp, Inc.

May 22, 2025

Page 4

6. With respect to any Purchase Contracts to be offered pursuant to the Registration Statement (the “Offered Purchase Contracts”), when (A) a Purchase Contract Agreement has been duly authorized, executed and delivered, and (B) such Offered Purchase Contracts have been duly executed and countersigned in accordance with such Purchase Contract Agreement and duly issued and delivered to the purchasers thereof against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, such Offered Purchase Contracts, when issued and sold in accordance with the duly authorized, executed and delivered applicable underwriting agreement or any other duly authorized, executed and delivered applicable purchase agreement, will constitute valid and binding obligations of the Company, enforceable against the Company in accordance with their terms.

7.With respect to any Rights to be offered pursuant to the Registration Statement (the “Offered Rights”), when (A) such Offered Rights are to be sold in a firm commitment underwritten offering or in a best efforts placement offering, an underwriting agreement or placement agency agreement with respect to such Offered Rights has been duly authorized, executed, and delivered, and (B) the rights agreements have been duly executed and such Offered Rights duly sold by the Company against payment therefor in accordance with any applicable rights agreement and in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, such Offered Rights will constitute the valid and binding obligations of the Company, enforceable against the Company in accordance with their terms.

8. With respect to any Units to be offered pursuant to the Registration Statement (the “Offered Units”), when such Offered Units have been duly executed and countersigned in accordance with the collateral arrangements, if any, and duly issued and delivered to the purchasers thereof against payment of the agreed-upon consideration therefor in the manner contemplated in the Registration Statement or any Prospectus Supplement relating thereto, such Offered Units, when issued and sold in accordance with the duly authorized, executed and delivered applicable underwriting agreement or any other duly authorized, executed and delivered applicable purchase agreement, will constitute valid and binding obligations of the Company, enforceable against the Company in accordance with their terms.

In connection with the opinions expressed above, we have assumed that, at or prior to the time of the delivery of any such security, (i) the Registration Statement, as finally amended (including all necessary post-effective amendments), shall have become and shall remain effective under the Securities Act; (ii) an appropriate prospectus supplement or term sheet (each, a “Prospectus Supplement”), if applicable, with respect to such Offered Securities shall have been prepared, delivered and filed in compliance with the Securities Act and the applicable rules and regulations thereunder; (iii) the Board of Directors (or a duly authorized committee thereof) shall have duly established the terms of such securities and duly authorized the issuance and sale of such securities, and such authorization shall not have been modified or rescinded; (iv) in the case of any Offered Preferred Shares or Offered Depositary Shares, the Board of Directors of the Company shall have approved a Certificate of Amendment with respect to the authorization, creation and designation of such Offered Preferred Shares or the Underlying Preferred


John Marshall Bancorp, Inc.

May 22, 2025

Page 5

Shares relating to the Offered Depositary Shares, respectively; (v) there shall not have occurred any change in law occurring after the date of this opinion letter affecting the validity or enforceability of such securities; and (vi) the Company is, and shall remain, validly existing as a corporation in good standing under the laws of the Commonwealth of Virginia. We also have assumed that none of the terms of any security to be established subsequent to the date hereof, nor the issuance and delivery of such security, nor the compliance by the Company with the terms of such security will violate any applicable law or will result in a violation of any provision of any instrument or agreement then binding upon the Company, or any restriction imposed by any court or governmental body having jurisdiction over the Company. Our opinions concerning the enforceability of any agreement or Offered Security may be limited by (A) bankruptcy, insolvency, fraudulent or voluntary conveyance, moratorium, liquidation, reorganization or similar federal or state laws affecting the enforcement of creditors’ rights in general, (B) general principles of equity, whether applied by a court of law or equity, including the possible unavailability of specific performance, appointment of a receiver or injunctive relief, (C) the exercise of discretionary powers by any court before which specific performance, injunctive relief or other equitable remedies may be sought, (D) other equitable remedies and defenses, (E) evidentiary and procedural requirements under applicable law, (F) principles of diligence, good faith, reasonableness, fair dealing, conscionability and materiality, (G) judicial discretion inherent in the forum addressing enforceability, (H) the effect of public policy on the enforceability of provisions relating to indemnification or contribution, (I) the effect of any limitation on enforceability arising from the issuance or promulgation of executive or similar orders by any governmental body. This opinion letter does not express any opinion concerning (i) the enforceability or applicability of any choice of law or analogous provision, or (ii) the Corporate Transparency Act of 2019, as amended.

You have informed us that you intend to issue the Offered Securities from time to time on a delayed or continuous basis. We understand that prior to issuing any Offered Securities you will afford us an opportunity to review all operative documents pursuant to which such Offered Securities are to be issued (including the applicable Prospectus Supplement) and will file such supplement or amendment to this opinion (if any) as we may reasonably consider necessary or appropriate by reason of the terms of such Offered Securities.

Our opinions are expressed as of the date hereof, and we do not assume any obligation to update or supplement our opinions to reflect any fact or circumstance subsequently arising or any change in law subsequently occurring after such date. Our opinions are limited to the matters expressly stated herein; no further opinion is implied or may be inferred beyond such matters. We hereby consent to the filing of this opinion letter with the Commission as an exhibit to the Registration Statement and to the reference to us under the caption “Legal Matters” in the Prospectus. In giving this consent, we do not thereby admit that we are an “expert” within the meaning of the Securities Act.

/s/ WILLIAMS MULLEN