7500 Old Georgetown Road Suite 1500 Bethesda, MD 20814 Exhibit 5.1 August 7, 2026 Eagle Bancorp, Inc. 7500 Old Georgetown Road, Fifteenth Floor, Bethesda, Maryland 20814 Ladies and Gentlemen: I am Senior Vice President and Deputy General Counsel of EagleBank, a Maryland commercial bank, which is the principal subsidiary of Eagle Bancorp, Inc. (the “Company”). I am providing this opinion in connection with the filing of the Company’s registration statement on Form S-8 (the “Registration Statement”) under the Securities Act of 1933 (the “Act”). The Registration Statement registers 180,000 shares of common stock of the Company, par value $0.01 per share (the “Shares”), that may be issued in connection with employment inducement equity awards granted to the Company’s newly appointed President and Chief Executive Officer, consisting of (i) sign-on equity awards comprising performance-based restricted stock units, restricted stock units and non-qualified stock options and (ii) make-whole equity awards comprising restricted stock units and non-qualified stock options ((i) and (ii) together, the “Awards”). The Awards are being granted outside of, and not pursuant to, the Eagle Bancorp, Inc. 2025 Equity Incentive Plan (the “Plan”) in reliance on the employment inducement award exception set forth in Nasdaq Listing Rule 5635(c)(4). The Awards are subject to and governed by the terms of the Plan as if such Awards had been granted under the Plan, except as otherwise provided in the applicable award agreement (collectively, the “Award Agreements”). In connection with the filing of the Registration Statement, I have examined such corporate records, certificates and other documents, and such questions of law, as I have considered necessary or appropriate for the purposes of this opinion. Upon the basis of such examination, I advise you that, in my opinion: Following the effectiveness of the Registration Statement, the Shares of the Company, when issued in accordance with the terms and conditions of the Award Agreements, will be legally issued, fully paid and non-assessable. The foregoing opinion is limited to laws of the State of Maryland, and I am expressing no opinion as to the effect of the laws of any other jurisdiction. I have relied as to certain factual matters on information obtained from public officials, officers of the Company and other sources believed by me to be responsible, and I have assumed that the signatures on documents examined by me are genuine. In rendering the foregoing opinion, I am not passing upon, and assume no responsibility for, any disclosure in any registration statement or any related prospectus or other offering material relating to the offer and sale of the Shares.
2 I hereby consent to the filing of this opinion as an exhibit to the Registration Statement. In giving such consent, I do not thereby admit that I am in the category of persons whose consent is required under Section 7 of the Act. Very truly yours, /s/ Scott Bernstein Scott Bernstein Senior Vice President, Deputy General Counsel EagleBank